Syslogd time is showing UTC in logs

Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions
Author Message
roland90
DD-WRT User


Joined: 22 Oct 2015
Posts: 123

PostPosted: Fri Dec 25, 2020 20:01    Post subject: Syslogd time is showing UTC in logs Reply with quote
I'm using build r44849 (11/20/20) and my local time is correct on my router's main page using NTP
Code:
Time Zone: Europe/Berlin
Server IP: time-d.nist.gov

But in /var/log/messages time is constantly in UTC timezone.
I tried to execute these commands followed #5913 but nothing changed.
Quote:
killall syslogd
syslogd -t -L -s 819200 -O /mnt/sda1/logs/messages.txt


How can I use my local time (UTC+1) in the system log?
Merry Xmas to all!
Sponsor
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12917
Location: Netherlands

PostPosted: Fri Dec 25, 2020 20:27    Post subject: Reply with quote
Leave server ip blank
_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
roland90
DD-WRT User


Joined: 22 Oct 2015
Posts: 123

PostPosted: Fri Dec 25, 2020 21:43    Post subject: Reply with quote
egc wrote:
Leave server ip blank

Thanks for the reply.
I deleted the server IP saved and restarted the router but unfortunately the time is still in UTC zone within the log file. :/
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6447
Location: UK, London, just across the river..

PostPosted: Fri Dec 25, 2020 23:42    Post subject: Reply with quote
roland90 wrote:
egc wrote:
Leave server ip blank

Thanks for the reply.
I deleted the server IP saved and restarted the router but unfortunately the time is still in UTC zone within the log file. :/


yep NTP time zones are messy, sometimes...
mine is fine im on 45109 last build...

if you need to specify server use their IP address instead of resolving names

162.159.200.123 this is cloudflare ntp

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
roland90
DD-WRT User


Joined: 22 Oct 2015
Posts: 123

PostPosted: Sat Dec 26, 2020 0:22    Post subject: Reply with quote
Alozaros wrote:
roland90 wrote:
egc wrote:
Leave server ip blank

Thanks for the reply.
I deleted the server IP saved and restarted the router but unfortunately the time is still in UTC zone within the log file. :/


yep NTP time zones are messy, sometimes...
mine is fine im on 45109 last build...

if you need to specify server use their IP address instead of resolving names

162.159.200.123 this is cloudflare ntp


Thanks the reply.
I tried that.

Interesting because some types of log are shown with correct time and some are not.

Correct:
syslog.info
daemon.info
cron.info
daemon.debug
daemon.err
user.info

Not correct:
kern.warn
kern.alert
kern.info
kern.debug

kern.warn is the most important to me
because this prints iptables drop/accept lines.
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14246
Location: Texas, USA

PostPosted: Sat Dec 26, 2020 0:37    Post subject: Reply with quote
No issues here, but I am not on the current release yet.
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
roland90
DD-WRT User


Joined: 22 Oct 2015
Posts: 123

PostPosted: Sat Dec 26, 2020 0:50    Post subject: Reply with quote
Thanks guys.
I modified also the start-up script with the -t option and now everything working fine.
Merry Xmas. Laughing Laughing
kernel-panic69
DD-WRT Guru


Joined: 08 May 2018
Posts: 14246
Location: Texas, USA

PostPosted: Sat Dec 26, 2020 1:22    Post subject: Reply with quote
What start-up script?
_________________
"Life is but a fleeting moment, a vapor that vanishes quickly; All is vanity"
Contribute To DD-WRT
Pogo - A minimal level of ability is expected and needed...
DD-WRT Releases 2023 (PolitePol)
DD-WRT Releases 2023 (RSS Everything)

----------------------
Linux User #377467 counter.li.org / linuxcounter.net
roland90
DD-WRT User


Joined: 22 Oct 2015
Posts: 123

PostPosted: Sat Dec 26, 2020 1:34    Post subject: Reply with quote
kernel-panic69 wrote:
What start-up script?

I had this in start-up:
Quote:
killall syslogd
syslogd -L -s 819200 -O /mnt/sda1/logs/messages.txt

and after restart I executed these 2 lines but syslogd with extra -t option and this is not enough.
I modified also the start-up and after reboot it worked perfectly.
No need to change these settings:
Quote:
Time Zone: Europe/Berlin
Server IP: time-d.nist.gov

Correct start-up script:
Quote:
killall syslogd
syslogd -L -t -s 819200 -O /mnt/sda1/logs/messages.txt
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6447
Location: UK, London, just across the river..

PostPosted: Sat Dec 26, 2020 8:10    Post subject: Reply with quote
roland90 wrote:
kernel-panic69 wrote:
What start-up script?

I had this in start-up:
Quote:
killall syslogd
syslogd -L -s 819200 -O /mnt/sda1/logs/messages.txt

and after restart I executed these 2 lines but syslogd with extra -t option and this is not enough.
I modified also the start-up and after reboot it worked perfectly.
No need to change these settings:
Quote:
Time Zone: Europe/Berlin
Server IP: time-d.nist.gov

Correct start-up script:
Quote:
killall syslogd
syslogd -L -t -s 819200 -O /mnt/sda1/logs/messages.txt


y do you need that script, at the first place??
I dont use it and all is fine...remove it and check again..

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
roland90
DD-WRT User


Joined: 22 Oct 2015
Posts: 123

PostPosted: Sat Dec 26, 2020 11:18    Post subject: Reply with quote
Alozaros wrote:
roland90 wrote:
kernel-panic69 wrote:
What start-up script?

I had this in start-up:
Quote:
killall syslogd
syslogd -L -s 819200 -O /mnt/sda1/logs/messages.txt

and after restart I executed these 2 lines but syslogd with extra -t option and this is not enough.
I modified also the start-up and after reboot it worked perfectly.
No need to change these settings:
Quote:
Time Zone: Europe/Berlin
Server IP: time-d.nist.gov

Correct start-up script:
Quote:
killall syslogd
syslogd -L -t -s 819200 -O /mnt/sda1/logs/messages.txt


y do you need that script, at the first place??
I dont use it and all is fine...remove it and check again..

Needed because I redirected the output to the pendrive.
Alozaros
DD-WRT Guru


Joined: 16 Nov 2015
Posts: 6447
Location: UK, London, just across the river..

PostPosted: Sat Dec 26, 2020 13:22    Post subject: Reply with quote
sorry, this is very lime, i didnt even look at it...and had a believe its about correct time script..
just paid more attention and realised, it for storing the log messages...how embarrassing for me...

yep back in the days, there was the same issue reported ..
I've no idea if it was sorted, i don't use logging mess on pendrive, nor on syslog server unless i need for debugging...

_________________
Atheros
TP-Link WR740Nv1 ---DD-WRT 55630 WAP
TP-Link WR1043NDv2 -DD-WRT 55723 Gateway/DoT,Forced DNS,Ad-Block,Firewall,x4VLAN,VPN
TP-Link WR1043NDv2 -Gargoyle OS 1.15.x AP,DNS,QoS,Quotas
Qualcomm-Atheros
Netgear XR500 --DD-WRT 55779 Gateway/DoH,Forced DNS,AP Isolation,4VLAN,Ad-Block,Firewall,Vanilla
Netgear R7800 --DD-WRT 55819 Gateway/DoT,AD-Block,Forced DNS,AP&Net Isolation,x3VLAN,Firewall,Vanilla
Netgear R9000 --DD-WRT 55779 Gateway/DoT,AD-Block,AP Isolation,Firewall,Forced DNS,x2VLAN,Vanilla
Broadcom
Netgear R7000 --DD-WRT 55460 Gateway/SmartDNS/DoH,AD-Block,Firewall,Forced DNS,x3VLAN,VPN
NOT USING 5Ghz ANYWHERE
------------------------------------------------------
Stubby DNS over TLS I DNSCrypt v2 by mac913
egc
DD-WRT Guru


Joined: 18 Mar 2014
Posts: 12917
Location: Netherlands

PostPosted: Sat Dec 26, 2020 13:37    Post subject: Reply with quote
Yes that should be taken care of.

What happens if you do not restart the syslog but just use the built in syslog/klog, does it show the correct time in /var/log/messages?

If so it might be needed to export the TZ with :
export TZ=UTC1

_________________
Routers:Netgear R7000, R6400v1, R6400v2, EA6900 (XvortexCFE), E2000, E1200v1, WRT54GS v1.
Install guide R6400v2, R6700v3,XR300:https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=316399
Install guide R7800/XR500: https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=320614
Forum Guide Lines (important read):https://forum.dd-wrt.com/phpBB2/viewtopic.php?t=324087
Display posts from previous:    Page 1 of 1
Post new topic   Reply to topic    DD-WRT Forum Index -> General Questions All times are GMT

Navigation

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You can attach files in this forum
You can download files in this forum