Yavuz Yasin CELIK created LOG4J2-1170:
-----------------------------------------

             Summary: SizeBasedTriggeringPolicy does not work properly on tomcat
                 Key: LOG4J2-1170
                 URL: https://issues.apache.org/jira/browse/LOG4J2-1170
             Project: Log4j 2
          Issue Type: Bug
          Components: Configurators
    Affects Versions: 2.4.1
            Reporter: Yavuz Yasin CELIK


<SizeBasedTriggeringPolicy size="20 MB"/>
Below configuration does not work properly on tomcat-6.For 20 MB log file, 
after tomcat server restart on first run, it work fine and archive files but on 
other turns, it does not archive log file even it is bigger than 20MB.

<SizeBasedTriggeringPolicy size="10 KB"/>
if you configure as 10 KB, it works fine.

<?xml version="1.0" encoding="UTF-8"?>
<Configuration name="UrbanCode">
  <Properties>
    <Property name="path">C:/Log</Property>
    <Property name="filename">UrbanCode</Property>
  </Properties>
  <Appenders>
    <RollingFile name="RollingFile" fileName="C:/Log/UrbanCode.log" 
filePattern="C:/Log/UrbanCode-%d{ddMMyyyy-HHmmss}.log.zip">
      <PatternLayout>
        
<Pattern>%d{yyyy-MM-dd}\t%d{HH:mm:ss}\t%-5level\t%class{36}\t%L\t%M\t%msg%xEx%n</Pattern>
      </PatternLayout>
      <Policies>
        <SizeBasedTriggeringPolicy size="20 MB"/>
      </Policies>
      <DefaultRolloverStrategy max="10"/>
    </RollingFile>
    <Console name="Console" target="SYSTEM_OUT" ignoreExceptions="false">
      <PatternLayout pattern="%M\t%msg%xEx%n"/>
    </Console>
  </Appenders>
  <Loggers>
    <Root level="Trace"> 
      <AppenderRef ref="RollingFile"/>
      <AppenderRef ref="Console"/>
    </Root>
  </Loggers>
</Configuration>



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to