aspose file tools*
The moose likes Other Open Source Projects and the fly likes not updating new file using DailyRollingFileAppender Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "not updating new file using DailyRollingFileAppender" Watch "not updating new file using DailyRollingFileAppender" New topic
Author

not updating new file using DailyRollingFileAppender

urmi Bir
Greenhorn

Joined: Sep 01, 2008
Posts: 4
Hi I have used following log4j.xml in my application for creating log files. Using DailyRollingFileAppender option the new file is created at midnight but the log messages are not logging into the file which is newly created. Suppose at midnight my old file changed to AutoTkt_MDB.log20080901 and new file is created as AutoTkt_MDB.log then messages are looged into �AutoTkt_MDB.log20080901� instead of �AutoTkt_MDB.log�
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j='http://jakarta.apache.org/log4j/'>
<appender name="generalLogFileAppender" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="/nmlwaslocal/autotkt/logs/AutoTkt_MDB.log" />
<param name="DatePattern" value="yyyy-MM-dd" />
<param name="Threshold" value="debug"/>
<param name="Append" value="true"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%t] %d{M/d/yy HH:mm:ss:SSS} %-5p %c{1} - %m%n" />
</layout>
</appender>
<appender name="errorLogFileAppender" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="/nmlwaslocal/autotkt/logs/AutoTkt_MDB_Error.log" />
<param name="DatePattern" value="yyyy-MM-dd" />
<param name="Threshold" value="warn"/>
<param name="Append" value="true"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%t] %d{M/d/yy HH:mm:ss:SSS} | EMAIL IDs: SUPPORT_PDL | PAGER NUMBERS: NONE| %-5p %c{1} - %m%n" />
</layout>
</appender>

<!-- Added New appender "messageLogFileAppender" for separate log file i.e. OVO_Integration_AT.log
Release 1.2 issue number 14 - added by Urmila - Start -->
<appender name="messageLogFileAppender" class="org.apache.log4j.DailyRollingFileAppender">
<param name="File" value="/nmlwaslocal/autotkt/logs/OVO_Integration_AT.log" />
<param name="DatePattern" value="yyyy-MM-dd" />
<param name="Append" value="true"/>
<layout class="org.apache.log4j.PatternLayout">
<param name="ConversionPattern" value="[%t] %d{M/d/yy HH:mm:ss:SSS} | EMAIL IDs: SUPPORT_PDL | PAGER NUMBERS: NONE| %-5p %c{1} - %m%n" />
</layout>
<filter class="org.apache.log4j.varia.LevelRangeFilter">
<param name="LevelMin" value="info"/>
<param name="LevelMax" value="info"/>
</filter>
</appender>

<logger name="infoLogger" additivity="false">
<appender-ref ref="messageLogFileAppender" />
</logger>
<!-- Release 1.2 issue number 14 - added by Urmila - End -->

<root>
<level value="debug" />
<appender-ref ref="generalLogFileAppender" />
<appender-ref ref="errorLogFileAppender" />
</root>
</log4j:configuration>


Please provide some solution on this. Thanks in advance.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: not updating new file using DailyRollingFileAppender