Log messages can be time-stamped and the source address of syslog messages can be set. This enhances real-time debugging and management.

When the service timestamps log uptime global configuration mode command is entered, the amount of time since the switch last booted is displayed on logged events. A more useful version of this command applies the datetime keyword in place of the uptime keyword; this forces each logged event to display the date and time associated with the event.

When using the datetime keyword, the clock on the networking device must be set. This can be accomplished in one of two ways:

Recall that NTP is a protocol that is used to allow network devices to synchronize their time settings with an NTP server.

To allow the software clock to be synchronized by an NTP time server, use the ntp server ip-address command in global configuration mode. A sample configuration is shown in the figure. R1 is configured as an NTP client, while router R2 serves as an authoritative NTP server. A network device can be configured as either an NTP server, thereby allowing other devices to synchronize off of its time, or as an NTP client.

For the remainder of the chapter, it is assumed that the clock has been set and the service timestamps log datetime command has been configured on all devices.