Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-712

Support UTC in timestamp element

    XMLWordPrintable

Details

    • Icon: New Feature New Feature
    • Resolution: Unresolved
    • Icon: Major Major
    • None
    • 1.0.6
    • None
    • None

    Description

      I have the following timestamp element:

      <timestamp key="compactTimestamp" datePattern="yyyyMMdd'T'HHmmss'Z'"/>

      for use in a file appender:

      <file>${LOG_DIR}/translator-${compactTimestamp}.log</file>

      Note the `Z' in the date pattern. However, the date that is generated is in local time. It would be preferable to have a GMT option as found in the pattern element:

      <pattern>%-80(%d

      {yyyy-MM-dd'T'HH:mm:ss.SSS'Z',GMT}

      %-5p [%t:%C

      {0}

      .%M]) %m%n</pattern>

      I am working around this by starting the VM with -Duser.timezone=UTC.

      Attachments

        Activity

          People

            logback-dev Logback dev list
            wohler Bill Wohler
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: