On Dec 4, 2007, at 3:12 AM, tststs wrote:
I am using log4j for logging. I am working on a huge application and
there
would be lots of logs each day. Thereby it is requried that the log
files be
stored and renamed each day. The date is appended to the log file
and that
day's log file is stored. The logs start writing afresh each day. The
problem here is that at times the application simply starts logging
to the
previous day's log file, for a while, and then starts writing back
to the
current day's file again. I am not able to figure out what goes
wrong and
when. The application is running on weblogic. Can anybody please
help? The
log4j properties file is here
log4j.rootCategory=DEBUG, dest1, dest2, dest3
log4j.appender.dest1=org.apache.log4j.DailyRollingFileAppender
log4j.appender.dest1.DatePattern='.'yyyy-MM-dd
log4j.appender.dest1.Threshold=info
log4j.appender.dest1.File=info.log
log4j.appender.dest1.layout=org.apache.log4j.PatternLayout
log4j.appender.dest1.layout.ConversionPattern=%d [%t: %C.%M:%L] %p:
%m%n
....
Thank in advance!!!
That scenario typically occurs when multiple instances of
DailyRollingFileAppender are writing to the same file. In this case,
your installation likely is loading log4j multiple times each of which
is trying to write to the same file or rename files that other
instances have open. Bad (but platform-specific) results will
follow. Java provides no platform-independent mechanism to detect or
workaround the collision. It just has to be avoided. Maybe that
gives you enough to avoid the issue or other more Weblogic-savvy users
will give specific advice.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]