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

Multiple footers written to file on system restart

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • None
    • None
    • Layouts
    • None
    • Important

    Description

      I created a custom layout that appends a header and footer to a rolling file appender with a time based and startup trigger policies which works great during normal circumstances except when it comes to system restarts. On shutdown the file is closed with the footer being written to the file, then on startup the startup trigger policy will open the file then immediately roll thus printing the footer again on rollover (prior to v2.4 the header was also written on startup LOG4J2-1030). I am attempting to produce well-formed XML with this particular use-case but it is getting mangled at this particular point. Ideally we can either have the footer either not print the second time or just perform the rollover on shutdown.

      Attachments

        1. LOG4J2-1228-test.diff
          4 kB
          Steve Davids

        Issue Links

          Activity

            People

              rgoers Ralph Goers
              sdavids Steve Davids
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: