dcsimg
DailyRollingFileAppender locks log files
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Grant_Sheppard
Posted On:   Wednesday, January 29, 2003 01:06 PM

I'm having a problem with the DailyRollingFileAppender in Log4J v1.2.7. An application that runs under SunOS 5.8 uses this appender to keep a daily rolling history of log files. As expected, Log4J rolls the log file over at the end of each day and adds a timestamp postfix. Henceforth, I have a series of files like: - MsatsHandler.log.2003-01-29 MsatsHandler.log.2003-01-28 MsatsHandler.log.2003-01-27, etc. The problem is that attempting to access any of these logs using standard Unix commands fail (eg. ls, less, cat, etc). The error returned is: - MsatsHandler.log.2003-01-29: No such file or directory I    More>>

I'm having a problem with the DailyRollingFileAppender in Log4J v1.2.7.


An application that runs under SunOS 5.8 uses this appender to keep a daily rolling history of log files. As expected, Log4J rolls the log file over at the end of each day and adds a timestamp postfix.


Henceforth, I have a series of files like: -



MsatsHandler.log.2003-01-29


MsatsHandler.log.2003-01-28


MsatsHandler.log.2003-01-27, etc.


The problem is that attempting to access any of these logs using standard Unix commands fail (eg. ls, less, cat, etc). The error returned is: -



MsatsHandler.log.2003-01-29: No such file or directory


I can have access the current log file without any problems. Another interesting fact is that the rolled over log files can be FTPed off the server to be viewed on another machine.


My simple Log4J configuration file is as follows: -



log4j.rootLogger=INFO,LOG_FILE
log4j.appender.LOG_FILE=org.apache.log4j.DailyRollingFileAppender
log4j.appender.LOG_FILE.layout=org.apache.log4j.PatternLayout
log4j.appender.LOG_FILE.layout.ConversionPattern=%d{dd/MM/yyyy HH:mm:ss.SSS} %-5p [%x] - %m%n
log4j.appender.LOG_FILE.File=/eai/phoenix/log/MsatsHandler.log
log4j.appender.LOG_FILE.DatePattern='.'yyyy-MM-dd


Any ideas?

   <<Less
About | Sitemap | Contact