dcsimg
problem of DailyRollingFileappender
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Hongtao_Liu
Posted On:   Thursday, October 11, 2007 06:41 AM

Hi,everybody, I encounter a proplem when using DailyRollingFileAppender. My log4j.properties is just as following. -------------------------- log4j.rootLogger=INFO, R log4j.appender.R=org.apache.log4j.DailyRollingFileAppender log4j.appender.R.File=/usr/local/apache2/logs/ userAgentDS.log log4j.appender.R.DatePattern='.'yyyy-MM-dd log4j.appender.R.layout=org.apache.log4j.PatternLayout log4j.appender.R.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss},%m%n -------------------------- The problem is that the log file of previous days gets overwritten in non-rolling time of a day.For example, Thu Oct 11 07:   More>>

Hi,everybody,
I encounter a proplem when using DailyRollingFileAppender. My log4j.properties is just as following.


--------------------------

log4j.rootLogger=INFO, R

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

log4j.appender.R.File=/usr/local/apache2/logs/
userAgentDS.log

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

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

log4j.appender.R.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss},%m%n


--------------------------


The problem is that the log file of previous days gets overwritten in non-rolling time of a day.For example,


Thu Oct 11 07:30:02 CST 2007

-rw-r--r-- 1 root root 262933 Oct 11 07:29 /usr/local/apache2/logs/userAgentDS.log

-rw-r--r-- 1 root root 1833258 Oct 10 23:59 /usr/local/apache2/logs/userAgentDS.log.2007-10-10

-rw-r--r-- 1 root root 1877410 Oct 9 23:59 /usr/local/apache2/logs/userAgentDS.log.2007-10-09


Thu Oct 11 07:31:01 CST 2007

-rw-r--r-- 1 root root 89 Oct 11 07:30 /usr/local/apache2/logs/userAgentDS.log

-rw-r--r-- 1 root root 263772 Oct 11 07:30 /usr/local/apache2/logs/userAgentDS.log.2007-10-09

-rw-r--r-- 1 root root 1833258 Oct 10 23:59 /usr/local/apache2/logs/userAgentDS.log.2007-10-10


Thu Oct 11 07:32:01 CST 2007

-rw-r--r-- 1 root root 264117 Oct 11 07:31 /usr/local/apache2/logs/userAgentDS.log.2007-10-09

-rw-r--r-- 1 root root 712 Oct 11 07:31 /usr/local/apache2/logs/userAgentDS.log

-rw-r--r-- 1 root root 1833258 Oct 10 23:59 /usr/local/apache2/logs/userAgentDS.log.2007-10-10



log4j logs message to userAgentDS.log.2007-10-09 on Oct 11 07:31 and content of userAgentDS.log.2007-10-09 replaced by userAgentDS.log of Oct 11.The log4j continue to log message to userAgentDS.log.2007-10-09 and stopping to log to userAgentDS.log.But it should log message to userAgentDS.log. Why and how to reslove this proplem?




Need your help.

Bbest regards and thanks


Hongtao Liu

   <<Less
About | Sitemap | Contact