• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

not updating new file using DailyRollingFileAppender

 
urmi Bir
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic