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

Retain the default date pattern after fixing ISO8601_PATTERN

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.0.1
    • 2.0.1
    • Layouts, Pattern Converters
    • None

    Description

      Scott Harrington correctly pointed out the following (from comments on LOG4J2-670):

      You're going to get complaints from more folks about changing this long-standing format, which happens to be the default if nothing is specified after the '%d'.
      What I mean is, a lot of people have been getting the space separator, and they are not explicitly asking for ISO8601, and now they're going to start getting a 'T' separator.
      Presence/absence of a space will affect anyone who slices up their log files using awk or cut with whitespace delimiters.

      I suggest you introduce a new pattern named 'DEFAULT' (and which gets used by default):

      %d{ISO8601} = yyyy-MM-dd'T'HH:mm:ss,SSS
      %d{ISO8601_BASIC} = yyyyMMdd'T'HHmmss,SSS
      %d = %d{DEFAULT} = yyyy-MM-dd HH:mm:ss,SSS
      

      Attachments

        Issue Links

          Activity

            People

              rpopma Remko Popma
              rpopma Remko Popma
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: