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

## Setting the Timestamp for Log Messages

You can use the service timestamps command to format timestamps for log messages. By default, log messages display universal coordinated time (UTC) without the time zone.

The following examples illustrate how you can change the timestamp on log messages.

- Set the time zone to eastern daylight time (EDT), 5 hours behind UTC, and display the local time on the log messages.
  `
  host1(config)#clock timezone EDT -5
  `

- Display UTC, but no time zone, on the log messages.

      host1(config)#service timestamps log datetime
      host1#exit
      host1#show log data category cliCommand severity info
      ***********************************************************
      NOTICE 05/14/2001 18:24:49 cliCommand: "configure terminal", console
      NOTICE 05/14/2001 18:24:45 cliCommand: "service timestamps log datetime", console
      ***********************************************************

- Display UTC and the time zone on the log messages.

      host1#configure terminal
      host1(config)#service timestamps log datetime show-timezone
      host1(config)#exit
      host1#show log data category cliCommand severity info
      ***********************************************************
      NOTICE 05/14/2001 18:28:45 UTC EDT cliCommand: "configure terminal", console
      NOTICE 05/14/2001 18:28:42 UTC EDT cliCommand: "service timestamps log datetime show-timezone", console
      ***********************************************************

- Display no timestamp on the log messages.

      host1#configure terminal
      host1(config)#no service timestamps
      host1#exit
      host1#show log data category cliCommand severity info
      ***********************************************************
      NOTICE 134 cliCommand: "configure terminal", console
      NOTICE 133 cliCommand: "no service timestamps", console
      ***********************************************************

service timestamps

- Use to format timestamps for log messages.
- For information about setting local times and time zones, see JUNOSe System Basics Configuration Guide.
- The show log data command displays the log data with the current timestamp format.
- The show log data nv-file command displays the log data with the timestamp format in effect at the time the log record was written.
- Use the no version to remove timestamps from log messages.
- See service timestamps.

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