Logger won't log for me

Greetings,

I read through a bunch of posts I was able to find, but for the life of me I still can't figure why logger won't log my message. It logs for others (services), but not when I call it. And of course it doesn't work from my scripts (no cron, no fancy stuff), which how I noticed it. It used to work. However, I don't know when it stopped working. Here's some info:

root@wr1043nd:~# logger "Just saying hello!"
root@wr1043nd:~# logread -l 10
Mon Oct  9 06:42:04 2023 daemon.info hostapd: wlan0: STA xx:xx:xx:xx:xx:xx WPA: pairwise key handshake completed (RSN)
Mon Oct  9 07:15:50 2023 daemon.notice hostapd: wlan0: AP-STA-DISCONNECTED xx:xx:xx:xx:xx:xx
Mon Oct  9 07:15:50 2023 daemon.info hostapd: wlan0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: disassociated due to inactivity
Mon Oct  9 07:15:51 2023 daemon.info hostapd: wlan0: STA xx:xx:xx:xx:xx:xx IEEE 802.11: deauthenticated due to inactivity (timer DEAUTH/REMOVE)
Mon Oct  9 09:45:41 2023 authpriv.info dropbear[29524]: Child connection from 192.168.nnn.nnn:49796
Mon Oct  9 09:45:42 2023 authpriv.warn dropbear[29524]: Pubkey auth attempt with unknown algo for 'root' from 192.168.nnn.nnn:49796
Mon Oct  9 09:45:42 2023 authpriv.warn dropbear[29524]: Pubkey auth attempt with unknown algo for 'root' from 192.168.nnn.nnn:49796
Mon Oct  9 09:45:42 2023 authpriv.warn dropbear[29524]: Pubkey auth attempt with unknown algo for 'root' from 192.168.nnn.nnn:49796
Mon Oct  9 09:45:42 2023 authpriv.warn dropbear[29524]: Pubkey auth attempt with unknown algo for 'root' from 192.168.nnn.nnn:49796
Mon Oct  9 09:45:45 2023 authpriv.notice dropbear[29524]: Password auth succeeded for 'root' from 192.168.nnn.nnn:49796

#####  ^^^^ Where is my message? #####

root@wr1043nd:~# cat /etc/openwrt_release 
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='19.07.8'
DISTRIB_REVISION='r11364-ef56c85848'
DISTRIB_TARGET='ath79/generic'
DISTRIB_ARCH='mips_24kc'
DISTRIB_DESCRIPTION='OpenWrt 19.07.8 r11364-ef56c85848'
DISTRIB_TAINTS=''

root@wr1043nd:~# cat /etc/config/system 
config system
	option ttylogin '0'
	option log_size '64'
	option urandom_seed '0'
	option zonename 'America/Chicago'
	option hostname 'wr1043nd'
	option log_proto 'udp'
	option conloglevel '8'
	option cronloglevel '5'
	option timezone 'CST6CDT,M3.2.0,M11.1.0'

Here's the funny part. I have another OpenWRT device (on the same network), and logger works fine - as expected. The only difference is that that device is on 21.02, while the above one is on 19.07. It doesn't have enough resources for me to upgrade it. But it used to work!

root@ac68u:~# logger "Just saying hi!"
root@ac68u:~# logread -l 10
Mon Oct  9 09:46:02 2023 daemon.info dnsmasq-dhcp[13527]: DHCPOFFER(eth0.3) 192.168.nnn.nnn xx:xx:xx:xx:xx:xx
Mon Oct  9 09:46:05 2023 daemon.info dnsmasq-dhcp[13527]: DHCPDISCOVER(eth0.3) xx:xx:xx:xx:xx:xx
Mon Oct  9 09:46:05 2023 daemon.info dnsmasq-dhcp[13527]: DHCPOFFER(eth0.3) 192.168.nnn.nnn xx:xx:xx:xx:xx:xx
Mon Oct  9 09:46:05 2023 daemon.info dnsmasq-dhcp[13527]: DHCPREQUEST(eth0.3) 192.168.nnn.nnn xx:xx:xx:xx:xx:xx
Mon Oct  9 09:46:05 2023 daemon.info dnsmasq-dhcp[13527]: DHCPACK(eth0.3) 192.168.nnn.nnn xx:xx:xx:xx:xx:xx WifiClock
Mon Oct  9 09:46:55 2023 authpriv.info dropbear[29030]: Child connection from 192.168.nnn.nnn:32930
Mon Oct  9 09:46:58 2023 authpriv.notice dropbear[29030]: Password auth succeeded for 'root' from 192.168.nnn.nnn:32930
Mon Oct  9 09:47:13 2023 daemon.info dnsmasq-dhcp[13527]: DHCPREQUEST(eth0.3) 192.168.nnn.nnn xx:xx:xx:xx:xx:xx
Mon Oct  9 09:47:13 2023 daemon.info dnsmasq-dhcp[13527]: DHCPACK(eth0.3) 192.168.nnn.nnn xx:xx:xx:xx:xx:xx kmc_plug_02
Mon Oct  9 09:47:18 2023 user.notice root: Just saying hi!

#### ^^^ There's my message! ####

root@ac68u:~# cat /etc/openwrt_release 
DISTRIB_ID='OpenWrt'
DISTRIB_RELEASE='21.02.0'
DISTRIB_REVISION='r16279-5cc0535800'
DISTRIB_TARGET='bcm53xx/generic'
DISTRIB_ARCH='arm_cortex-a9'
DISTRIB_DESCRIPTION='OpenWrt 21.02.0 r16279-5cc0535800'
DISTRIB_TAINTS=''

root@ac68u:~# cat /etc/config/system 
config system
	option ttylogin '0'
	option log_size '64'
	option urandom_seed '0'
	option hostname 'ac68u'
	option zonename 'America/Chicago'
	option timezone 'CST6CDT,M3.2.0,M11.1.0'
	option log_proto 'udp'
	option conloglevel '8'
	option cronloglevel '5'

I would appreciate any suggestions on how to fix my 19.07.

Cheers!
tjk :slight_smile:

Maybe logger is left out of your build because of size constraints?
Test with:

root@DL-WRX36:~# which logger
/usr/bin/logger

Note logger is part of busybox as far as I know

root@wr1043nd:~# which logger
/usr/bin/logger

The program is there. Otherwise I would've gotten "not found" type of error. Since I don't get any errors, I can only assume it executes fine, but it fails to "persist" the message. And obviously at least some services are using the logging system fine.

19.07 is EOL so I hope you can find support for it

I am aware 19.07 is EOL. I don't think it's a bug, and I am not expecting a code fix. I do know the logging subsystem works, and logger worked for me at some time. So I believe I messed something somewhere. What I am hoping is that someone here sees my post, and has resolved that issue back in the day when they were running 19.07. Long shot, but still... My plan B is to add my own logging. Plan C is to upgrade the device/OS. Or the other way around would be better... :slight_smile:

Logger worked for me as long as I used 19.07, years ago.
And there has not been any real changes to logd/logread (actually ubox) or busybox for ages in 19.07.

1 Like

Do you even realize that such a comment is in no way any meaningful nor helpful?
We are not talking about 4 year old and by the time bleeding edge and buggy wifi driver but a standard system util.

(And no, I do not have any idea why logger could even refuse to function out of the blue sky.)

I'd recommend making a backup of your config, then resetting to defaults. Try the logger from the default state and see if it works. Then, restore your config and see if logger still works or if it breaks. From there, we'll have more to go on for troubleshooting.

That said, the points about this being for 19.07 do make sense -- this is an EOL and unsupported version, and it is sufficiently old as to have fairly significant changes in how it works generally and syntax of configs and the like. As a result, those differences may make it hard to get support (people may not remember the old syntax, for example). Further, due to the nature of the security vulnerabilities that exist in old releases, it is wise to upgrade when possible.

3 Likes

Darn it! The router had an uptime of 3+ months. @psherman's config suggestion is great - applicable to many scenarios. But I figured before I go that route, let me reboot the device. What do you know - now it works as expected. I thought the "1. Is it plugged in? 2. Did you reboot it?" checklist is so 2010s. Should've tried reboot, and I would not have taken up your time.

And yes, I need to upgrade the router, but in addition to newer hardware, I have some other dependencies to resolve.

Thank you all for taking the time on this thread.

Cheers! :slight_smile:

:weary: of course :sweat: some times the obvious doesn't come to the mind.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.