Just tested it - seems to work perfectly.
Thanks a lot for your help!
 
ML

________________________________

Von: Arunkumar [mailto:[EMAIL PROTECTED]
Gesendet: Mi 24.05.2006 17:20
An: 'Log4CXX User'
Betreff: RE: Question: MaxBackupIndex RollinfIleappender XML config Howto



Hi Martin,

This is a file that I used to test the rolling file appender and it worked.
I used one of the unit test xml input files and modified it.
Replace the values as per your requirements. Also replace
testcxxlogging.level2.l2r and testcxxlogging.level2.l2r.c1 with your logger
names. I defined these loggers in a parent and child class respectively.

-Arun

<?xml version="1.0" encoding="UTF-8" ?>

<log4j:configuration xmlns:log4j='http://logging.apache.org/' debug="true">

  <appender name="ROLLING"
class="org.apache.log4j.rolling.RollingFileAppender">
    <rollingPolicy
class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
       <param name="fileNamePattern" value="filterBased-test.%i.log"/>
       <param name="minIndex" value="0"/>       
         <param name="maxIndex" value="3" />
    </rollingPolicy>
       
        <triggeringPolicy
class="org.apache.log4j.SizeBasedTriggeringPolicy">
                <param name="MaxFileSize" value="2KB"/>    
        </triggeringPolicy>

        <layout class="org.apache.log4j.PatternLayout">
      <param name="ConversionPattern" value="%m%n"/>
    </layout>
    <param name="file" value="filterBased-test.log"/>
    <param name="append" value="true"/>

  </appender>

  <logger name="testcxxlogging.level2.l2r" additivity="true">
    <appender-ref ref="ROLLING"/>
    <level value="info"/>
  </logger>

  <logger name="testcxxlogging.level2.l2r.c1" additivity="false">
    <appender-ref ref="ROLLING"/>
    <level value="warn"/>
  </logger>

</log4j:configuration>

________________________________________
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
rg] On Behalf Of LECHNER Martin
Sent: Wednesday, May 24, 2006 7:02 AM
To: Log4CXX User
Subject: AW: Question: MaxBackupIndex RollinfIleappender XML config Howto

 
Unfortuantely the configuration does not work.
I still get 7 backup files (seems to be the default in
FixedWindowRollingPolicy)
 
Is there still an error in the config file?
 
best regards
ML
 
 
 
 
 





<<winmail.dat>>

Reply via email to