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

daily log rotate not working on my tomcat server for catalina.log

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Critical
    • Resolution: Unresolved
    • 2.17.0
    • None
    • Configuration
    • None

    Description

      on my tomcat server only daily log rotate is not working,  logs are recorded on the same catalina.log file.   SizeBasedTriggeringPolicy and OnStartupTriggeringPolicy is working as expected.

      below are the log4j2-tomcat.xml file trace

      <?xml version="1.0" encoding="utf-8"?>
      <Configuration status="info">
          <Properties>
              <Property name="logdir">${sys:catalina.base}/logs</Property>
              <Property name="layout">TOMCAT %d [%t] %5p %c %m%n</Property>
          </Properties>
          <Appenders>
              <RollingFile name="CATALINA" fileName="${logdir}/catalina.log" filePattern="${logdir}/catalina.%d{yyyy-MM-dd}-%i.log">
                  <PatternLayout pattern="${layout}"/>
                  <Policies>

                      <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
                      <SizeBasedTriggeringPolicy size="5MB"/>
                      <OnStartupTriggeringPolicy />
                  </Policies>
                  <DefaultRolloverStrategy max="30"/>
              </RollingFile>
          </Appenders>
          <Loggers>
              <Root level="INFO">
                  <AppenderRef ref="CATALINA"/>
              </Root>
              <Logger name="org.apache.catalina.core.ContainerBase.[Catalina].[localhost]" level="info" additivity="false">
                  <AppenderRef ref="CATALINA"/>
              </Logger>
          </Loggers>
      </Configuration>

      Attachments

        Activity

          People

            Unassigned Unassigned
            omarsheriff mohamed omar sheriff
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated: