[Contents] [Prev] [Next] [Index] [Report an Error]

Including the Year or Millisecond in Timestamps

By default, the timestamp recorded in a standard-format system log message specifies the month, date, hour, minute, and second when the message was logged, as in the following example:

Aug 21 12:36:30

To include the year, the millisecond, or both in the timestamp, include the time-format statement at the [edit system syslog] hierarchy level:

edit system syslog]
time-format (year | millisecond | year millisecond);

The modified timestamp is used in messages directed to each destination configured by a file, console, or user statement at the [edit system syslog] hierarchy level, but not to destinations configured by a host statement.

The following example illustrates the format for a timestamp that includes both the millisecond (401) and the year (2006):

Aug 21 12:36:30.401 2006

Note: Messages logged in structured-data format (available in JUNOS 8.3 and later for file destinations) include the year and millisecond by default. If you include the structured-data statement at the [edit system syslog file filename] hierarchy level along with the time-format statement, the time-format statement is ignored and messages are logged in structured-data format.

For information about the structured-data statement, see Logging Messages in Structured-Data Format. For information about the information in a structured-data message, see Displaying a Log File from a Single-Chassis System.


[Contents] [Prev] [Next] [Index] [Report an Error]