Help us improve your experience.

Let us know what you think.

Do you have time for a two-minute survey?

Navigation

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);

However, the timestamp for traceoption messages is specified in milliseconds by default, and is independent of the [edit system syslog time-format] statement.

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 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 contents of a structured-data message, see the Junos OS System Log Messages Reference.

Published: 2013-01-23