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 "Kenneth Taylor (JIRA)" <ji...@apache.org> on 2015/08/10 16:27:45 UTC
[jira] [Commented] (LOG4J2-1073) RollingFileAppender working file
and archives have wrong date values
[ https://issues.apache.org/jira/browse/LOG4J2-1073?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14680176#comment-14680176 ]
Kenneth Taylor commented on LOG4J2-1073:
----------------------------------------
We are also seeing this problem and it started happening a few micro versions back. It may be related to Java 8. The %d{} pattern is not working if you enter any date formatting characters. The special key values like COMPACT still work. On our systems %d{yyyy} yields 5301.
> RollingFileAppender working file and archives have wrong date values
> --------------------------------------------------------------------
>
> Key: LOG4J2-1073
> URL: https://issues.apache.org/jira/browse/LOG4J2-1073
> Project: Log4j 2
> Issue Type: Bug
> Components: Core
> Affects Versions: 2.3
> Reporter: Ben Hess
>
> Suppose I have RollingFile appenders within a Route. Configuration below explanation - pretty typical, should rollover every day.
> Suppose today's date is Jul 2 2015, and the program has been running since Jun 30 2015.
> So for each Routed RollingFile I should have three files with entries having the correct dates:
> program-general.log - has entries from 7/2/2015 only
> program-general.2015-07-01.log - has entries from 7/1/2015 only
> program-general.2015-06-30.log - has entries from 6/30/2015 only
> Except what I have is the following:
> program-general.log - has entries from 6/30 - 7/02
> program-general.2015-07-01.log - has entries from 6/30 - 7/01
> program-general.2015-06-30.log - has entries from 6/30
> The relevant configuration:
> <Appenders>
> <RollingFile name="generalAppender" fileName="logs/program-general.log" filePattern="logs/program-general.%d{yyyy-MM-dd}.log">
> <PatternLayout pattern="%d [%t] %-5p %c{1} - %m%n %ex"/>
> <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
> <DefaultRolloverStrategy max="7"/>
> </RollingFile>
> <Routing name="RoutingAppender">
> <Routes pattern="${ctx:propertyId}">
> <Route>
> <RollingFile name="Rolling-${ctx:propertyId}"
> fileName="logs/program-${ctx:propertyId}.log"
> filePattern="logs/program-${ctx:propertyId}.%d{yyyy-MM-dd}.log">
>
> <PatternLayout pattern="%d [%t] %-5p %c{1} - %m%ex%n"/>
> <TimeBasedTriggeringPolicy interval="1" modulate="true"/>
> <DefaultRolloverStrategy max="7"/>
> </RollingFile>
> </Route>
> <Route ref="generalAppender" key="${ctx:propertyId}"/>
> </Routes>
> </Routing>
> </Appenders>
--
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