Need sequencial steps for DailyRollingfileappender.
0 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Abraham_Priyan
Posted On:   Thursday, April 9, 2009 12:54 PM

Hi, I have noticed a very weird behaviour for DailyRollingfileappender and i am not able to resolve this. I have a triggering program which run 24X7 and this invokes another program on receiving the trigger message. I am trying to print the log message for both the programs into seperate log file using log4j and DailyRollingfileappender property. The property of log4j is set to DailyRollingFileAppender. log4j.appender.RF=org.apache.log4j.DailyRollingFileAppender log4j.appender.RF.DatePattern='.'yyyy-MM-dd-a log4j.appender.RF.File=logs/abc.log log4j.appender.RF.layout=org.apache.log4j.PatternLayout log4j.appender.RF.layout.ConversionPattern=%p %c %d{dd-MMM-y   More>>

Hi,


I have noticed a very weird behaviour for DailyRollingfileappender and i am not able to resolve this.

I have a triggering program which run 24X7 and this invokes another program on receiving the trigger message.
I am trying to print the log message for both the programs into seperate log file using log4j and DailyRollingfileappender property.
The property of log4j is set to DailyRollingFileAppender.


log4j.appender.RF=org.apache.log4j.DailyRollingFileAppender
log4j.appender.RF.DatePattern='.'yyyy-MM-dd-a

log4j.appender.RF.File=logs/abc.log
log4j.appender.RF.layout=org.apache.log4j.PatternLayout

log4j.appender.RF.layout.ConversionPattern=%p %c %d{dd-MMM-yyyy HH:mm:ss} - %m%n


The logs for the triggering program is getting invoked properly and it is getting rolled over also but the invoked program is always throwing me an error
says physical file is not found.


The code goes like at first the properties file is read and then the physical file is checked and the property is set to logger.


So my question is how does the log4j DailyRollingFileAppender sequence work?

Is there any chance of log file getting rolled over when the logger class is initiallized?    <<Less
About | Sitemap | Contact