The problem is that Windows holds a lock on the log file, preventing log4j from renaming it to an archive version. Thus when the next log is started, it simply overwrites the old log instead of writing to a new log.

Purportedly the new version of log4j addresses this, but I haven't had a chance to test it. There are also mods to log4j floating around to address this. I'm playing around with scheduling an at command to rename the log file a few minutes before log4j rolls over the file, but haven't worked out the bugs yet.

Dave Jones
NetEffect


At 03:23 PM 3/2/04 +0000, you wrote:
I am using log4j in my Tomcat-based application to create daily log files
using the DailyRollingFileAppender.

The development environment is Tomcat 5.0.16 on a Windows XP-based machine
and the production environment is Tomcat 5.0.19 on Linux-based server.

I use exactly the same log4j jar files on each.

The problem is that in the XP-based system the DailyRollingFileAppender does
not create any archive files.

However, on the Linux-based machine everything works as expected.

Any ideas?

The properties file I am using is given below. (I comment out whichever
"log4j.appender.R.File=..." line is appropriate for the development
environment the file is deployed in.)


# Assign two appenders to root logger log4j.rootLogger=DEBUG, R

# Rolling file appender
log4j.appender.R=org.apache.log4j.DailyRollingFileAppender

# for Windows Home on development machine
log4j.appender.R.File=E:/SoftwareDevelopment/eclipse/workspace/amxtrcdeploy/
WEB-INF/log4j-logfiles/admin_log

# for Linux on production server
#
log4j.appender.R.File=/projects/amexback/webapp/WEB-INF/log4j-logfiles/admin
_log

# roll the file over every minute! (Just for testing.)
# log4j.appender.R.DatePattern='.'yyyy-MM-dd-HH-mm

# roll the file over daily, at midnight
log4j.appender.R.DatePattern='.'yyyy-MM-dd

log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%d %-5p %m%n
log4j.appender.R.threshold=INFO

# Print only messages of level INFO or above from the admin.audit logger
log4j.logger.admin.audit=INFO



---------------------------------------------------------------------
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]



Reply via email to