Looking at the instructions for Log4j, never having had to set up Logging before and constantly ridling my code with System.out's that need to be commented out all the time, i figure, what the hey. I'll implement log4j...
I am thinking there should be a simple example out there on how to set it up with my struts application, after sifting through the non applicable examples and the language of doublespeak, i am left 2 hours later with no logging set up.
I have dropped log4j jar into my lib directory under webapps, and i intended to have a class that extended action that i would set up a logger in. this way each action i had would inherently have a logger available to it without having to set up it's own. My system would not deal with the PropertyConfigurator at all, even though i could successfully import it, it would'nt compile any of the examples.
With Log4j ready and the following class skeleton, what would be my best way to set up a simple, very simple logger that my action classes could inherit? Once i get it working i guess i could conquer the more detailed aspects...
package com.cgi.excelsior.actions;
import javax.servlet.http.HttpServletRequest;
import javax.sql.DataSource;
import org.apache.struts.action.Action;
import org.apache.log4j.*;
public class ExcelsiorAction extends Action{
public DataSource getDatasource(HttpServletRequest request, String key)
{
return this.getDataSource(request, key);
}
}