Hello list,

This is, I am sure, a newbie problem, but I cannot figure out how to set up my logger so it logs to a file.

I have a number of classes in my web app. I instantiate my logger in my init servlet with:

PropertyConfigurator.configure(Constants.SITEPATH+"/WEB-INF/classes/RMLog4j.properties");

my properties file looks like this:

log4j.rootCategory=DEBUG, RM
log4j.appender.RM=org.apache.log4j.FileAppender
log4j.appender.RM.File=RM.log
log4j.appender.RM.layout=org.apache.log4j.PatternLayout
log4j.appender.RM.layout.ConversionPattern=%d{ABSOLUTE} [%t] %-5p %-30.30c{2} %x - %m %n


In one of my actions I instantiate and call the logger like this:

private final static Logger actionLogger = Logger.getLogger(LogonAction.class);

...

       actionLogger.info("INFO HERE");
       actionLogger.debug("Starting Action debug");
       actionLogger.warn("Starting Action warning");
       actionLogger.fatal("FATAL");


Its obvious that I am missing something here.


Can anyone give me a pointer or two?

I tried to construct it without using the properties file http://supportweb.cs.bham.ac.uk/documentation/tutorials/docsystem/build/tutorials/log4j/log4j.html#LOG4J-Basics-Basics-Example-SimpAndFile

and that worked (i got the output from the example code)

TIA

Denis



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to