[
https://issues.apache.org/jira/browse/LOG4J2-1765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15798310#comment-15798310
]
Ralph Goers commented on LOG4J2-1765:
-------------------------------------
I believe this is resolved with the changes for LOG4J2-1653. Please try with
the latest code.
> [2.7]about CrontriggeringPolicy to renaming old file
> ----------------------------------------------------
>
> Key: LOG4J2-1765
> URL: https://issues.apache.org/jira/browse/LOG4J2-1765
> Project: Log4j 2
> Issue Type: Question
> Components: Appenders
> Affects Versions: 2.7
> Environment: Windows7 OS machine
> Reporter: xucheng
>
> Hello:
> I tried CrontriggeringPolicy(*added 2.7*) for save log files at specific
> time.
> My goal is, for example.
> if now is 2017-01-04 18:00:00, "info.log" <- active file.
> and when 2017-01-04 18:01:00, "info.log" will be renamed
> "info.2017-01-04-18-00.log", and create new "info.log".
> But my problem is when 2017-01-04 18:01:00, "info.log" renamed
> "info.2017-01-04-17-59.log".
> I want to make that file's name "info.2017-01-04-18-00.log" because that
> file has 2017-01-04 18:00:00~2017-01-04 18:01:00's log,
> Here's my configure xml.
> {code:xml}
> <RollingFile name="infoFile" fileName="logs/info.log"
> filePattern="logs/info.%d{yyyy-MM-dd-HH-mm}.log" append="true"
> immediateFlush="true">
> <PatternLayout>
> <Pattern>%d %p\t%m%n</Pattern>
> </PatternLayout>
> <Policies>
> <CronTriggeringPolicy schedule="0 */1 * * * ? *"/>
> </Policies>
> <Filters>
> <ThresholdFilter level="warn" onMatch="DENY"
> onMismatch="NEUTRAL" />
> <ThresholdFilter level="info" onMatch="ACCEPT"
> onMismatch="DENY" />
> </Filters>
> </RollingFile>
> {code}
> Please help me.
> Thanks for your help, I'm very appreciated it .
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]