Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-7965

Add Year to Logging Timestamp

    • Type: Icon: Improvement Improvement
    • Resolution: Done
    • Priority: Icon: Minor - P4 Minor - P4
    • 2.5.2
    • Affects Version/s: 2.2.2
    • Component/s: Logging
    • Labels:
      None
    • Minor Change

      Implementation Details
      New command-line option for configuration:

      --logTimestampFormat=(ctime|iso8601-utc|iso8601-local)
      

      The beginning of the Unix Epoch is formatted as follows in the three formats, assuming America/New_York for the time zone.

      ctime:         Wed Dec 31 19:00:00.000
      iso8601-utc:   1970-01-01T00:00:00.000Z
      iso8601-local: 1969-12-31T19:00:00.000+0500
      

      Original description
      Log parsing with date ranges can be tricky without a year in the timestamp by default, especially near the end/start of the year.

      Rather than the current:

      Thu Dec 13 16:39:15 [log message]
      

      Perhaps:

      Thu Dec 13 2012 16:39:15 [log message]
      

            Assignee:
            schwerin@mongodb.com Andy Schwerin
            Reporter:
            adam@comerford.net Adam Comerford
            Votes:
            2 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: