Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-1170

SizeBasedTriggeringPolicy does not work properly on tomcat

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.4.1
    • None
    • Configurators

    Description

      <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>
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            ysnclk Yavuz Yasin CELIK
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: