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 "xucheng (JIRA)" <ji...@apache.org> on 2017/01/04 10:19:58 UTC

[jira] [Updated] (LOG4J2-1765) [2.7]about CrontriggeringPolicy to renaming old file

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

xucheng updated LOG4J2-1765:
----------------------------
    Summary: [2.7]about CrontriggeringPolicy to renaming old file  (was: about CrontriggeringPolicy)

> [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: log4j-dev-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-dev-help@logging.apache.org