xucheng created LOG4J2-1765:
-------------------------------

             Summary: about CrontriggeringPolicy
                 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-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-dev-h...@logging.apache.org

Reply via email to