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

Unable to reinstate old timeMillis timestamp using log4j2.clock property in JSON layout

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • None
    • 2.13.2
    • None
    • None

    Description

      As per the changes listed in https://logging.apache.org/log4j/2.0/changes-report.html#a2.11.0, it seems the timestamp is now being reported as "instant":{"epochSecond":1555050778,"nanoOfSecond":738424000} (for instance) in the JSON output.

      I'd like to however revert back to the old timeMillis format because it's easier to parse using a log forwarder. As per the documentation found, it seems I should be able to use log4j2.clock=SystemMillisClock property to revert this behaviour. That doesn't seem to work though. I've tried both variants of the property I could find in the docs (log4j.Clock and log4j2.clock).

      Am I misinterpreting the documentation? I just want an easy way to get back the timeMillis.

      Attachments

        Activity

          People

            rgoers Ralph Goers
            siwyd Simon Wydooghe
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: