You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-dev@logging.apache.org by "Benjamin Jaton (JIRA)" <ji...@apache.org> on 2015/07/28 20:56:04 UTC

[jira] [Created] (LOG4J2-1087) Reload of RolloverStrategy doesn't work

Benjamin Jaton created LOG4J2-1087:
--------------------------------------

             Summary: Reload of RolloverStrategy doesn't work
                 Key: LOG4J2-1087
                 URL: https://issues.apache.org/jira/browse/LOG4J2-1087
             Project: Log4j 2
          Issue Type: Bug
            Reporter: Benjamin Jaton
         Attachments: reload.txt

I am using this configuration :

{code}<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="DEBUG" monitorInterval="2">
  <Appenders>
    <RollingFile name="RollingFile" fileName="/tmp/test/app.log" filePattern="/tmp/test/app.log.%i">
      <PatternLayout>
        <Pattern>%d %p %c{1.} [%t] %m%n</Pattern>
      </PatternLayout>
      <Policies>
        <SizeBasedTriggeringPolicy size="100KB"/>
      </Policies>
      <DefaultRolloverStrategy max="5"/>
    </RollingFile>
  </Appenders>
  <Loggers>
    <Root level="info" includeLocation="false">
      <AppenderRef ref="RollingFile"/>
    </Root>
  </Loggers>
</Configuration>{code}

I am changing the DefaultRolloverStrategy "max" attribute from 5 to 10.
I can see the reloading take place from the StatusLogger (full log attached):

{code}DEBUG Starting configuration XmlConfiguration[location=/usr/local/apps/log4j2-test.xml]
(...)
DEBUG Found factory method [createStrategy]: public static org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy.createStrategy(java.lang.String,java.lang.String,java.lang.String,java.lang.String,org.apache.logging.log4j.core.config.Configuration).
2015-07-24 12:08:00,938 DEBUG Calling createStrategy on class org.apache.logging.log4j.core.appender.rolling.DefaultRolloverStrategy for element DefaultRolloverStrategy with params(name="10", name="null", name="null", name="null", Configuration(/usr/local/apps/log4j2-test.xml)){code}

So log4j2 is seeing the changes, but there is still only 5 files produced 1->5.

(I made sure that I was producing enough log data)

If I change the message pattern, I see it change in the log file, but not the RolloverStrategy parameters.



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

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org