Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Backup logfile not being created

Status
Not open for further replies.

mpinnock

Technical User
Mar 29, 2006
2
US
using log4j with rollingfile appender, however, the system fails to create a backup file after the initial backup file reaches its limit.

This isn't always consistent - for example, sometime I am able to see multiple backup files, but the next time I run the application the first file keeps getting overwritten and a second or subsequent backup files are not created.

Can someone provide assistance with this issue?

Cheers
Michael
 
More info. Post your logging configuration and information on how your application is put together with respect to logging.

Tim
 
Tim - thanks for your follow-up. I am enclosing a sample of the config file that I am using - it shows the rollingfile appender, file size and number of backup files that I am trying to keep.

log4j.rootLogger=debug, R

log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout

# Pattern to output the caller's file name and line number.
log4j.appender.stdout.layout.ConversionPattern=%5p [%10t] %d{dd MMM yyyy HH:mm:ss,SSS} (%F:%L) - %m%n

log4j.appender.R=org.apache.log4j.RollingFileAppender
#log4j.appender.R=org.apache.log4j.DailyRollingFileAppender
#log4j.appender.R.DatePattern='.'dd-mm-yyyy
log4j.appender.R.File=${catalina.home}/logs/pds_trace.log
log4j.appender.R.MaxFileSize=25MB
# Keep one backup file
log4j.appender.R.MaxBackupIndex=40
log4j.appender.R.layout=org.apache.log4j.PatternLayout
log4j.appender.R.layout.ConversionPattern=%5p [%10t] %d{dd MMM yyyy HH:mm:ss,SSS} (%F:%L) - %m%n
#log4j.appender.R.layout.ConversionPattern=%5p %t %c - %m%n

log4j.additivity.com.crystaldecisions=false

log4j.appender.ac = org.apache.log4j.ConsoleAppender
log4j.appender.ac.layout=org.apache.log4j.PatternLayout

log4j.appender.ac.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n

log4j.appender.ac.file=crystal.log
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top