Cixiang created LOG4J2-2246:
-------------------------------

             Summary: CronTrigger not rolling file correctly
                 Key: LOG4J2-2246
                 URL: https://issues.apache.org/jira/browse/LOG4J2-2246
             Project: Log4j 2
          Issue Type: Bug
          Components: Core
    Affects Versions: 2.10.0, 2.8.2
            Reporter: Cixiang


Configure a rolling file appender with a cron trigger policies:

<RollingFile name="rollingLog" 
filePattern="${basePath}/${webAppName}-%d\{yyyyMMdd-HHmmss}.log">

    <Policies>

        <CronTriggeringPolicy schedule="0 0 0/12 * * ?"  
evaluateOnStartup="true"/>

    </Policies>

</RollingFile>

then, after runing some days, I got log files:

-rw-r----- 1 xchgcode xchgcode 133876 2月 11 23:59 xchgCode-20180211-120000.log
-rw-r----- 1 xchgcode xchgcode 168375 2月 12 11:58 xchgCode-20180212-000000.log
-rw-r----- 1 xchgcode xchgcode 353094 2月 13 11:59 xchgCode-20180212-120000.log
-rw-r----- 1 xchgcode xchgcode 74250 2月 13 17:16 xchgCode-20180213-120000.log

 

Look at the file "xchgCode-20180212-120000.log" and 
"xchgCode-20180213-120000.log", a file should named by 
"xchgCode-20180213-000000.log" is missing.

 

when I opened "xchgCode-20180212-120000.log", I found that the log time start 
at 2018-02-12 12:00:34.751 and end at 2018-02-13 11:59:59.753

 

Log file should rolling at 2018-02-13 00:00:00, but it not.

 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to