On 26 Mar 2004 13:59:25 -0000, struts-user-digest-help wrote
> Re: Pls help me in configuring common logger
>       109791 by: sougata

sougata, if you're using Log4j you need to add a file called
commons-logging.properties file under your WEB-INF/classes directory.  In that
file you need one line:
org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger

Its been my experience that the commons logger does not actually default to
Log4j if its available.

Here is an example of a log4j.properties file:
log4j.rootLogger=ERROR, A1, A2

log4j.appender.A1=org.apache.log4j.ConsoleAppender
log4j.appender.A1.layout=org.apache.log4j.PatternLayout
log4j.appender.A1.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

log4j.appender.A2=org.apache.log4j.DailyRollingFileAppender
log4j.appender.A2.file=[file path]
log4j.appender.A2.append=true
log4j.appender.A2.layout=org.apache.log4j.PatternLayout 
log4j.appender.A2.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

The first one is configured for standard out.  The second one writes logs to a
file [file path].  This file should also go under WEB-INF/classes

Roy.

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

Reply via email to