r1 - 26 Nov 2007 - 02:54:06 - ZacSim?You are here: TWiki >  Main Web  >  ElixirRepertoireServer > DailyRollingFileAppender

Daily Rolling File Appender

This allows the logging(Log4j) to re-create a daily .log file and save the previous daily .log file according to it's date. Replace the following code in config\log-config.xml -

Existing code shown in your log-config.xml for the Server.log appender -

   <appender name="Server" class="org.apache.log4j.RollingFileAppender">
      <param name="File" value="../log/server.log"/>
      <param name="Append" value="false"/>
      <param name="Encoding" value="UTF-8"/>
      <param name="MaxBackupIndex" value="5"/>
      <param name="MaxFileSize" value="500KB"/>
      <layout class="org.apache.log4j.PatternLayout">
        <param name="ConversionPattern" 
                            value="%d{ISO8601},%t,%-5p, %c{2} - %m%n"/>
      </layout>
   </appender>

Change the above code to -

   <appender name="Server" class="org.apache.log4j.DailyRollingFileAppender">
      <param name="File" value="../log/server.log"/>
      <param name="Append" value="false"/>
      <param name="Encoding" value="UTF-8"/>
      <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern" 
                            value="%d{ISO8601},%t,%-5p, %c{2} - %m%n"/>
      </layout>
   </appender>

Note: This also applies to the rest of the appender - JDBC, Jetty, Activity & Job logs.

-- ZacSim? - 26 Nov 2007

Edit | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r1 | More topic actions
 
Powered by TWiki
This site is powered by the TWiki collaboration platformCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback