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

RollingRandomAccessFile rolling files incorrectly

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Not A Problem
    • 2.3
    • 2.4
    • Appenders
    • None
    • Windows 8 64bit, Weblogic Server 12.1.2

    Description

      Implemented Loggers using RollingRandomAccessFile appender with
      this configuration:
      <RollingRandomAccessFile name="SystemAppender"
      filename="${fileLogDir}/system.log"
      filePattern="${fileLogDir}/$${date:yyyy-MM}/system-%d

      {yyyy-MM-dd}

      -%i.log"
      append="false">
      ....
      <Policies>
      <OnStartupTriggeringPolicy/>
      <SizeBasedTriggeringPolicy size="${fileSize}"/>
      <!-TimeBasedTriggeringPolicy/->
      </Policies>
      <DefaultRolloverStrategy max="${numGenerations}"/>
      ...
      Ran a test writing 5'000 log events (each approx. 500 bytes long) to 1 file with fileSize=100 KB & numGenerations=5.
      Result: system.log file partly contained content from system-2015-07-27-5.log file (found entries 4795-5000 as expected, but unexpectedly also found entries 4783-4794 of gen. 5 file there).

      Attachments

        Activity

          People

            Unassigned Unassigned
            njaybee Niels Bøg
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: