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

CsvLogEventLayout NanoTime timestamp is always zero.

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 2.4
    • Fix Version/s: None
    • Component/s: Layouts
    • Labels:
      None

      Description

      CsvLogEventLayout generates NanoTime timestamps but these are always zero.
      To fix this, add the below code to the CsvLogEventLayout constructor:

            // LOG4J2-1074 Switch to actual clock if nanosecond timestamps are required in config.
            // LoggerContext will notify known NanoClockFactory users that the configuration has changed.
            NanoClockFactory.setMode(NanoClockFactory.Mode.System);
      

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                rpopma Remko Popma
              • Votes:
                1 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated: