At 10:33 AM 3/21/2005 +0530, you wrote: >Hi, > >I have configured my web-app for log4j. Though, log statements are going >to the log file, I find only some of them going to the log file and not >all.
Well, if you log file is exactly as you have it below, then that is very odd behavior because the A1 appender is being used by the root logger. Are you sure another config file isn't getting picked up than the one below?
BTW, where is log4j.jar? is it in your WEB-INF/lib or are you using one in the container, such as in Tocmat's common/lib? Also, are you configuring manually or counting on autoconfiguration with log4j.properties in WEB-INF/classes? No autoconfiguration for the webapp will be performed if log4j.jar is only in common/lib and Tomcat's Log4j logging has been configured already at container startup. Putting log4j.jar in WEB-INF/lib will ensure that this is not an issue.
>Also, the log file keeps truncating after some log statements >randomly. I am not able to figure out the reason behind it. I have set >my Appender to 'DailyRollingFileAppender'. > >In the properties file I have assigened the value false to 'Append' >property of log4j. >
You do realize that append=false means that upon each configuration of Log4j, the file pointed to by the A1 appender will be cleared and start logging from line 1, right? So, each time the webapp restarts, your log file will be cleared (assuming configuration is happening upon each restart).
Jake
>Here is my property file :
>
>log4j.rootLogger=DEBUG, A1
>log4j.appender.A1=org.apache.log4j.DailyRollingFileAppender
>log4j.appender.A1.File=/usr/local/Events_Horizon/EHLog/test.log
>
>log4j.appender.A1.ImmediateFlush=true
>log4j.appender.A1.DatePattern='.'yyyy-MM-dd
>log4j.appender.A1.layout=org.apache.log4j.PatternLayout
>log4j.appender.A1.layout.ConversionPattern=%d{dd MMM yyyy HH:mm:ss}
>%-5p: %m%n
>log4j.appender.A1.Append=false
>
>Please help as early as possible.
>
>Nehal
>
>
>
>
>----------------------------------------------------------
>Netcore Solutions Pvt. Ltd.
>Website: http://www.netcore.co.in
>Spamtraps: http://cleanmail.netcore.co.in/directory.html
>----------------------------------------------------------
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
