title: Log4j2 rolling over file with wrong timestamp
body: <p>I am using log4j2 -
  org.apache.logging.log4j-log4j-api-2.14.1.jar</p>
  <p>and for clean up policy, I am using CronbasedTriggerPolicy, after adding cron based trigger policy, whenever log4j2 rolls over the files, it replaces the date and time stamp with 0's</p>
  <p>This is how my config looks like</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;
  &lt;Configuration status=&quot;INFO&quot;&gt;
      &lt;Appenders&gt;
          &lt;RollingFile fileName=&quot;data/appname-${date:yyyy-MM-dd_HH:mm:ss:SSS}.gz&quot; filePattern=&quot;data/appname-%d{yyyy-MM-dd_HH:mm:ss.SSS}.%03i.gz&quot; name=&quot;AppAppender&quot;&gt;
              &lt;PatternLayout&gt;
                  &lt;pattern&gt;%-6p %d{yyyy-MM-dd HH:mm:ss.SSS} %c{1}: %m%n
                  &lt;/pattern&gt;
              &lt;/PatternLayout&gt;
              &lt;Policies&gt;
                  &lt;OnStartupTriggeringPolicy/&gt;
                  &lt;SizeBasedTriggeringPolicy size=&quot;10MB&quot;/&gt;
                  &lt;CronTriggeringPolicy schedule=&quot;*/5 * * * *&quot;/&gt;
              &lt;/Policies&gt;
              &lt;DefaultRolloverStrategy&gt;
                  &lt;Delete basePath=&quot;data/&quot; maxDepth=&quot;2&quot;&gt;
                      &lt;IfFileName glob=&quot;*appname-*.gz&quot;/&gt;
                      &lt;IfLastModified age=&quot;1d&quot;/&gt;
                  &lt;/Delete&gt;
              &lt;/DefaultRolloverStrategy&gt;
          &lt;/RollingFile&gt;
          &lt;Console name=&quot;console&quot; target=&quot;SYSTEM_OUT&quot;&gt;
              &lt;PatternLayout pattern=&quot;[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n&quot;/&gt;
          &lt;/Console&gt;
      &lt;/Appenders&gt;
      &lt;Loggers&gt;
          &lt;Logger additivity=&quot;false&quot; name=&quot;com.app.Test&quot;&gt;
              &lt;AppenderRef ref=&quot;AppAppender&quot;/&gt;
          &lt;/Logger&gt;
      &lt;/Loggers&gt;
  &lt;/Configuration&gt;
  </code></pre>
  <p>When logs are being written to file file looks like this -
  <code>appname-2021-10-28_16:35:01:393.gz</code></p>
  <p>After rolling over file changes to this-
  <code>appname-2021-10-28_00:00:00.000.001.gz</code></p>
  <p>Why is log4j2 changing the timestamp to all 0s? and this started happening after I added the cron trigger policy, if I remove it, things work as expected. My final agenda is to have log4j2 delete all files that are older than 2 weeks. I am just playing with the config for a day right now.</p>