Uploaded image for project: 'Log4j 2'
  1. Log4j 2
  2. LOG4J2-3148

CronTriggeringPolicy with createOnDemand="false" always creates files

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 2.14.1
    • None
    • None
    • None

    Description

      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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            hban Hrvoje Ban
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: