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

Changes in SizeBasedTriggeringPolicy has no effects when automatic reconfiguration is on.

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.2, 2.3
    • Fix Version/s: 2.5
    • Component/s: Appenders
    • Labels:
      None

      Description

      My config is very simple:

      <?xml version="1.0" encoding="UTF-8"?>
      <configuration xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' strict="true" monitorInterval="5">
        <appenders>
          <appender type="console" name="CONSOLE">
            <layout type="PatternLayout" pattern="%5p %10c %C{1}(%L) - %m%n"/>
          </appender>
          <appender name="BOOT" type="rollingfile" fileName="boot.log" filePattern="boot-%i.log" append="true">
            <layout type="PatternLayout" pattern="%5p %10c %C{1}(%L) - %m %ex%n"/>
            <SizeBasedTriggeringPolicy size="1 kb" />
            <DefaultRolloverStrategy />
          </appender>
        </appenders>
        <loggers>
          <root level="all">
            <appender-ref ref="CONSOLE"/>
            <appender-ref ref="BOOT"/>
          </root>
        </loggers>
      </configuration>
      

      This is because when you create a RollingFileAppender again it uses the previously created RollingFileManager obtained from MAP (AbstractManager (69)). But in my case, the name is already exists, so appropriate manager already been created. But "data" parameter are not the same when manager was created at first time. It contains new value of policy.

        Attachments

        1. LOG4J2-381.patch
          5 kB
          Anthony Baldocchi

          Issue Links

            Activity

              People

              • Assignee:
                ralph.goers@dslextreme.com Ralph Goers
                Reporter:
                mailer67 Alexander Khokhlov
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: