You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Aivaras Dziaugys (Jira)" <ji...@apache.org> on 2021/06/01 04:32:00 UTC
[jira] [Reopened] (LOG4J2-3101) SizeBasedTriggeringPolicy does not
update date on rollover
[ https://issues.apache.org/jira/browse/LOG4J2-3101?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Aivaras Dziaugys reopened LOG4J2-3101:
--------------------------------------
Solution suggested in comment does not work, documentation contradicts the response comment.
> SizeBasedTriggeringPolicy does not update date on rollover
> ----------------------------------------------------------
>
> Key: LOG4J2-3101
> URL: https://issues.apache.org/jira/browse/LOG4J2-3101
> Project: Log4j 2
> Issue Type: Bug
> Components: Appenders
> Affects Versions: 2.14.1
> Environment: OS: Windows 10
> SpringBoot: 2.4.4/2.5.0
> Java: Zulu-11
> Reporter: Aivaras Dziaugys
> Priority: Minor
>
> Using _RollingFile_ appender with _SizeBasedTriggeringPolicy_ does not update date specified in _filePattern_ on rollover. The dates on log files are always evaluated to start time of the application.
> To quickly reproduce issue I was injecting custom org.apache.logging.log4j.core.util.Clock implementation via LOG4J_CLOCK environment variable.
> My log4j2.xml :
> {code:java}
> <?xml version="1.0" encoding="UTF-8"?>
> <Configuration status="WARN" monitorInterval="30">
> <Properties>
> <Property name="LOG_PATTERN">%d{yyyy-MM-dd'T'HH:mm:ss.SSSZ} %p %m%n</Property>
> <Property name="APP_LOG_ROOT">/home/aivaras/tmp</Property>
> </Properties>
> <Appenders>
> <RollingFile name="appLog"
> fileName="${APP_LOG_ROOT}/SpringBoot2App/application.log"
> filePattern="${APP_LOG_ROOT}/SpringBoot2App/application-%d{yyyy-MM-dd}-%i.log">
> <PatternLayout pattern="${LOG_PATTERN}" />
> <Policies>
> <SizeBasedTriggeringPolicy size="1 KB" />
> </Policies>
> <DefaultRolloverStrategy max="20" />
> </RollingFile>
> <Console name="Console" target="SYSTEM_OUT" follow="true">
> <PatternLayout pattern="${LOG_PATTERN}" />
> </Console>
> </Appenders>
> <Loggers>
> <Root level="debug">
> <AppenderRef ref="appLog" />
> <AppenderRef ref="Console" />
> </Root>
> </Loggers>
> </Configuration>
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)