You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Bharat Kumar Meda <Bh...@infosys.com> on 2006/12/29 07:19:12 UTC

Help on DailyRollingFileAppender : existing file getting overwritten

Hi,



When log4j files are to be renamed as previous day's log files (appends
the previous day's date at midnight), they are getting overwritten with
the first five minutes of the present day's logs.



As a result, the whole log file of the previous day is lost.



Also the jar we are referring for log4j is log4j-1.2.8.jar.

Could it because of an old version of jar?



Thanks in advance for your inputs,

Bharat



Please find below the log4j.properties file we are using:



log4j.rootLogger=debug, stdout, R

# Appender class for rootLogger stdout

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

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

log4j.appender.stdout.layout.ConversionPattern=%d %5p [%x] (%F:%L) -
%m%n



# Appender class for rootLogger R

log4j.appender.R=org.apache.log4j.DailyRollingFileAppender

log4j.appender.R.DatePattern='.'yyyy-MM-dd

log4j.appender.R.File=./vRepair.log

log4j.appender.R.MaxFileSize=1024KB



# Keep one backup file

#log4j.appender.R.MaxBackupIndex=3



# Pattern to output to logger R
log4j.appender.R.layout=org.apache.log4j.PatternLayout

log4j.appender.R.layout.ConversionPattern=[%d] [%5p] [%t] - %m%n



**************** CAUTION - Disclaimer *****************
This e-mail contains PRIVILEGED AND CONFIDENTIAL INFORMATION intended solely for the use of the addressee(s). If you are not the intended recipient, please notify the sender by e-mail and delete the original message. Further, you are not to copy, disclose, or distribute this e-mail or its contents to any other person and any such actions are unlawful. This e-mail may contain viruses. Infosys has taken every reasonable precaution to minimize this risk, but is not liable for any damage you may sustain as a result of any virus in this e-mail. You should carry out your own virus checks before opening the e-mail or attachment. Infosys reserves the right to monitor and review the content of all messages sent to or from this e-mail address. Messages sent to or from this e-mail address may be stored on the Infosys e-mail system.
***INFOSYS******** End of Disclaimer ********INFOSYS***