Log message timestamps may be configured to display either the date and time or the router's uptime. If configured for uptime, the log output is similar to this:
1d23h: %PARSER-3-BADSUBCMD: Unrecognized
subcommand 0 in interface command 'media-type'
The 1d23h: in this example indicates the router has been up for 1 day and 23 hours.
If the log timestamps are configured for datetime, the log output is similar to the following:
Jun 10 06:49:52: %LINK-3-UPDOWN: Interface Ethernet13/0/0, changed
state to up
This output indicates the date and time the error occurred.
If the log messages on the router display the amount of time the router has been up instead of the date and time of the error, this can be changed by issuing the service timestampsglobal configuration command. The command syntax is similar to one of these examples:
service timestamps message-type [uptime]
service timestamps message-type datetime [msec] [localtime] [show-timezone]
The type can be either debug or log. Debug is for the timestamp, while debugging and log are for the timestamp on regular log messages.
For example, to configure timestamps for logging to display the date and time as well as the time zone, the command is this: