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

TimeBasedTriggeringPolicy with limited number of files

    XMLWordPrintableJSON

Details

    • Wish
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.0-beta9
    • None
    • Appenders
    • None
    • Linux, Java 1.7, Maven

    Description

      In my application, I need a RollingFile-Appender with a TimeBasedTriggeringPolicy (e.g. 1 file each day with a filePattern="log-%d(yyyy-MM-dd).log").
      The oldes logfiles should been erased automatically when a limit is reached (e.g. max 100 files).

      On the first view, it looks that this could be configured using:

        <DefaultRolloverStrategy max="100"/>
      

      but for me it looks, that this setting does not work within this context.

      I have quite spend a few hours to solve this requirement but failed for now.
      For may be i'd done wrong things, could you give a small sample log4j2.xml which do this job?

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              FreeJoe Joe Merten
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: