Clock in Logs

Answered Question
Oct 17th, 2013
User Badges:

Hello Friends - I am seeking your help in understanding why the timestamp shown in Logs differ from Router Clock set thru NTP. Here is my observation

Note: both the routers are SYNC with NTP server at Strarum 3


Router-1 Configuration


service timestamps log datetime msec localtime

     here log messages (show log output) matches with Clock (show clock)

Router-2 Configuration

service timestamps log datetime msec

     here log messages (show log output) doesn't matches with Clock (show clock). There is some difference of +3hrs 20 minutes (additional in Log message timestamp)

May i know from where the logs assumes the time in Router-2 ? I am not seeing this time in NTP


Thanks in advance

SAIRAM                  

Correct Answer by Vasilii Mikhail... about 3 years 10 months ago

Hello.


If you enter "service timestamps log datetime localtime", then you see local time (that is CDT).

If you omit "localtime", then time is shown for UTC (5 hours later than CDT); so the event happend at 15:44:31 UTC = 10:44:31 CDT.


PS: for multinational companies it's a best practice to keep routers' clock in UTC (and timestamps as well).

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (1 ratings)
Loading.
snarayanaraju Thu, 10/17/2013 - 10:19
User Badges:

Friends - To add more to get more visibility here is the output


Router-2

rtr2# show clock
12:17:16.860 CDT Thu Oct 17 2013

rtr2#show ntp assoc

  address         ref clock       st   when   poll reach  delay  offset   disp
*~165.130.1.7     65.49.70.244     3    347   1024   377 27.565 -10.826 14.835

rtr2-st0564# show log | in Oct 17

033016: Oct 17 15:44:31.420: %IPPHONE-6-UNREGISTER_ABNORMAL

Correct Answer
Vasilii Mikhail... Thu, 10/17/2013 - 10:55
User Badges:
  • Gold, 750 points or more

Hello.


If you enter "service timestamps log datetime localtime", then you see local time (that is CDT).

If you omit "localtime", then time is shown for UTC (5 hours later than CDT); so the event happend at 15:44:31 UTC = 10:44:31 CDT.


PS: for multinational companies it's a best practice to keep routers' clock in UTC (and timestamps as well).

snarayanaraju Thu, 10/17/2013 - 11:06
User Badges:

Thank you Mikhailovsky - Sounds logic. Here is the observation


rtr1#show clock

13:04:36.973 CDT Thu Oct 17 2013


rtr1#show log | in Oct 17

502468: Oct 17 18:03:46.133: %SEC-6-IPACCESSLOGP:


Excellent.. Thanks again


SAIRAM

Actions

This Discussion