[ 
https://issues.apache.org/jira/browse/LOG4J2-2685?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Ralph Goers closed LOG4J2-2685.
-------------------------------
    Fix Version/s: 2.13.2
       Resolution: Duplicate

This was fixed by the fix for LOG4J2-2766

> Automatic Reconfiguration fails in case of change in the triggeringpolicy
> -------------------------------------------------------------------------
>
>                 Key: LOG4J2-2685
>                 URL: https://issues.apache.org/jira/browse/LOG4J2-2685
>             Project: Log4j 2
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.12.0
>         Environment: Windows 10 + Tomcat 8.5 + Log4j2
>            Reporter: gaurav
>            Priority: Blocker
>             Fix For: 2.13.2
>
>         Attachments: log4j2.xml, stacktrace.log
>
>
> Hi all,
> I'm using log4j2 in a web app. I'm using RollingFileAppender and 
> monitorInterval.
> The automatic reconfiguration fails with the following exception:
> _java.lang.IllegalStateException: +*Pattern does not contain a date*+_
> *Steps*:-
>  * Change filePattern from "_${web:rootDir}/server.%i.log_" to 
> "_${web:rootDir}/server.log.%d\{yyyy-MM-dd}_"
>  * Remove <SizeBasedTriggeringPolicy size="2MB"/> from <Policies> and add 
> <TimeBasedTriggeringPolicy interval="1"/>
>  * Save log4j2.xml
> *What I suspect?* 
> The RollingFileManager sets the triggering policy first and then sets the 
> patternprocessor.
> While setting the triggering policy, it uses the old pattern which does not 
> contain the RolloverFrequency. So, it throws IllegalStateException with the 
> message
> "*Pattern does not contain a date*".
> *Possible solution?*
> In the updateData() of RollingFileManager, set the new pattern processor 
> first and then set the triggering policy.
> I have also attached my log4j2.xml and the stacktrace of the error for your 
> reference.
> Please assist with the issue.
> Thanks



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to