logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brown, Keith" <K_Br...@DirectAdvice.com>
Subject RE: DailyRollingFileAppender
Date Tue, 23 Apr 2002 14:07:59 GMT
Try eliminating the MaxFileSize and the MaxBackupIndex parameters.  As far
as I can tell therer are only the options for DatePattern, Append, and File
parameters.  I have had the following working for the last year or so.

<appender name="FILE" class="org.apache.log4j.DailyRollingFileAppender ">
	<param name="File" value="server.log"/>
	<param name="DatePattern" value="yyyy-MM-dd'.log'"/>
	<param name="Append" value="false"/>
	<layout class="org.apache.log4j.PatternLayout">
		<param name="ConversionPattern" value="%-5p [%t] %c %x -
%m%n"/>
	</layout>
</appender>

-----Original Message-----
From: Tim Sawyer [mailto:tsawyer@nildram.co.uk]
Sent: Tuesday, April 23, 2002 7:11 AM
To: log4j-user@jakarta.apache.org
Cc: Tim Sawyer
Subject: DailyRollingFileAppender


Hello.

I'm trying to get my logging to produce one log file per day, ie create a
new file for each day.  It doesn't appear to be working.

Can someone give this XML config a quick once over and tell me if I've done
something obviously wrong?

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
<log4j:configuration debug="false"
xmlns:log4j="http://jakarta.apache.org/log4j>

  <!-- This file is used to configure the logging code that is present
       in the toolkit.  See http://jakarta.apache.org/log4j/ for more
details ->

        <appender name="A1"
class="org.apache.log4j.DailyRollingFileAppender">
          <param name="File" value="log/PersonalLoan.log"/>
          <param name="Append" value="true"/>
          <param name="MaxFileSize" value="100MB"/>
          <param name="MaxBackupIndex" value="5"/>
          <param name="DatePattern" value="'.'yyyy-MM-dd"/>   
          <layout class="org.apache.log4j.PatternLayout">
             <param name="ConversionPattern" value="%d{dd-MMM-yyyy HH:mm:ss}
[%t] %-5p %C{2} - %m%n"/>
          </layout>
        </appender>

        <root>
          <priority value="debug"/>
          <appender-ref ref="A1"/>
        </root>
</log4j:configuration>

ta,

Tim.



--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:log4j-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:log4j-user-help@jakarta.apache.org>


Mime
View raw message