[
https://issues.apache.org/jira/browse/LOG4J2-509?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Alexander Khokhlov updated LOG4J2-509:
--------------------------------------
Description:
{code:xml|title=Configuration fragment}
<RollingRandomAccessFile name="RollingFile" fileName="target/output.log"
filePattern="target//output.$${date:yyyyMMdd-HHmmss}-%i.log" >
<Policies>
<OnStartupTriggeringPolicy/>
<SizeBasedTriggeringPolicy size="20 KB"/>
</Policies>
<DefaultRolloverStrategy max="10"/>
<PatternLayout>
<Pattern>%d %p %C{1.} [%t] %m%n</Pattern>
</PatternLayout>
</RollingRandomAccessFile>
{code}
With provided configuration, result files will be named as follows:
output.20140123-005437-1.log
output.20140123-005440-1.log
output.20140123-005444-1.log
output.20140123-005448-1.log
output.20140123-005451-1.log
instead of:
output.20140123-005437-1.log
output.20140123-005440-2.log
output.20140123-005444-3.log
output.20140123-005448-4.log
output.20140123-005451-5.log
as I expected
As a result, DefaultRolloverStrategy also not working.
If to use SimpleDateFormat instead of DateLookup, then the result is the same.
was:
With provided configuration, result files will be named as follows:
output.20140123-005437-1.log
output.20140123-005440-1.log
output.20140123-005444-1.log
output.20140123-005448-1.log
output.20140123-005451-1.log
instead of:
output.20140123-005437-1.log
output.20140123-005440-2.log
output.20140123-005444-3.log
output.20140123-005448-4.log
output.20140123-005451-5.log
as I expected
As a result, DefaultRolloverStrategy also not working.
If to use SimpleDateFormat instead of DateLookup, then the result is the same.
> Substitution for a {%i} index does not work properly when date pattern is
> contains seconds.
> -------------------------------------------------------------------------------------------
>
> Key: LOG4J2-509
> URL: https://issues.apache.org/jira/browse/LOG4J2-509
> Project: Log4j 2
> Issue Type: Bug
> Components: Appenders, Core
> Affects Versions: 2.0-beta9, 2.0-rc1
> Reporter: Alexander Khokhlov
>
> {code:xml|title=Configuration fragment}
> <RollingRandomAccessFile name="RollingFile" fileName="target/output.log"
> filePattern="target//output.$${date:yyyyMMdd-HHmmss}-%i.log" >
> <Policies>
> <OnStartupTriggeringPolicy/>
> <SizeBasedTriggeringPolicy size="20 KB"/>
> </Policies>
> <DefaultRolloverStrategy max="10"/>
> <PatternLayout>
> <Pattern>%d %p %C{1.} [%t] %m%n</Pattern>
> </PatternLayout>
> </RollingRandomAccessFile>
> {code}
> With provided configuration, result files will be named as follows:
> output.20140123-005437-1.log
> output.20140123-005440-1.log
> output.20140123-005444-1.log
> output.20140123-005448-1.log
> output.20140123-005451-1.log
> instead of:
> output.20140123-005437-1.log
> output.20140123-005440-2.log
> output.20140123-005444-3.log
> output.20140123-005448-4.log
> output.20140123-005451-5.log
> as I expected
> As a result, DefaultRolloverStrategy also not working.
> If to use SimpleDateFormat instead of DateLookup, then the result is the same.
--
This message was sent by Atlassian JIRA
(v6.1.5#6160)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]