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

TimeBasedTriggeringPolicy not work if no log written in the next hour

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Not A Bug
    • None
    • None
    • None
    • None

    Description

      I want to create a new file every hour, but it does not work if no log written in the next hour(s), log4j2.xml configured as below:

      <RollingFile name="RollingFile-for-bigdata" filename="${logPath}/bigdata/${logName}user_register.log" filepattern="${logPath}/bigdata/bak/b_%d

      {yyyyMMddHH}

      _user_register.dat">
      <PatternLayout pattern="%msg%n" />
      <Policies>
      <TimeBasedTriggeringPolicy interval="1" modulate="true" />
      </Policies>
      <Filters>
      ....
      </Filters>
      <DefaultRolloverStrategy max="24" />
      </RollingFile>

      Attachments

        Activity

          People

            Unassigned Unassigned
            sstong123 Shushan Tong
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: