Remote logging timestamps

I am doing remote logging from my router to a linux server. The log lines are sent with a time which router local time, and no indication of timezone set on the router.

Is there a way to use a timezone in the router, but ensure that the log records get sent with either (1) UTC or (2) explicit time zone? I would assume this is a non-obvious flag for the router's remote logging service.

Thanks!

I could not find anything that would directly solve your problem. I had a look in remote logs produced by Cisco ASA and it seems that the same format is used:
Jan 6 17:55:36 SOME_IP_ADDR %ASA-6-302015: Built outbound UDP connection 18093091 for...
However you might find handy the option log_prefix "Adds a prefix to all log messages send over network. "
where you could specify the timezone.

log_prefix is an interesting hack around the problem, though the timezone and time would then be seperated by the hostname in the logs.

Using logging software that is compliant with https://tools.ietf.org/html/rfc5424 timestamps should resolve the timezone issue. You might want to look into syslog_ng or rsyslogd

1 Like