You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@logging.apache.org by "Hrvoje Ban (Jira)" <ji...@apache.org> on 2021/08/25 07:52:00 UTC

[jira] [Created] (LOG4J2-3148) CronTriggeringPolicy with createOnDemand="false" always creates files

Hrvoje Ban created LOG4J2-3148:
----------------------------------

             Summary: CronTriggeringPolicy with createOnDemand="false" always creates files
                 Key: LOG4J2-3148
                 URL: https://issues.apache.org/jira/browse/LOG4J2-3148
             Project: Log4j 2
          Issue Type: Bug
    Affects Versions: 2.14.1
            Reporter: Hrvoje Ban


Every time CRON policy triggers, it will always create a new log file, even when {{createOnDemand}} is set to {{false}}.

What I would expect:
 * If nothing was written to log before CRON was triggered, just do nothing, and don't open new file.
 * If something was written, then rotate/rename current file, but don't open a new log file.

To provide more context for this - I have several {{RollingFile}}s with CRON policy, but they are not used very often. I also have custom layout with header defined, so new log files are never really empty. And I'd like (if possible) not to have a bunch a basically empty log files.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)