service timestamps log is a Cisco IOS global-configuration command that controls the time information attached to Syslog messages. Timestamps may show the event's date and time or the device's uptime. section 7.2.1
Choose the timestamp format according to the operational need:
- service timestamps log datetime records the date and time of the event; datetime is generally preferred for correlating logs across devices. section 7.2.1
- service timestamps log uptime records the time elapsed since the device booted; check uptime with show version. section 7.2.1
- service timestamps log datetime localtime uses the device's local time zone instead of the default UTC. section 7.2.1
- service timestamps log datetime msec adds milliseconds, producing an hh:mm:ss.msec timestamp format. section 7.2.1
Typical configuration
SW1(config)# service timestamps log datetime msec This configuration records Syslog events with date-and-time values and millisecond precision. Use service timestamps log datetime localtime when local-zone timestamps are required. section 7.2.1 section 7.3
