Attempting to write logs to pendrive, 0 byte file?

Hi there,

In the long process to tackle an obscure but serious bug in my setup (Teams and certain complex setups of Zoom cutting off all network connectivity, no matter the platform it's running on), I wanted to get the most detailed logs onto a USB drive, but also wanted to avoid this kind of situation. So I plugged an older 4GiB drive, formatted it, mounted it, and made sure it is auto-mounted.

And before anyone asks, no, I couldn't use the NAS as a log destination: if network connectivity is disrupted, there's no guarantee the NAS will stay reachable. So only local logging.

I then went to the LuCI interface, and just wrote /mnt/sda/syslog.log in the "Write system log to file", then applied. The file is indeed correctly created, but stays at 0 bytes (That's the first issue). It seems as if the setting wasn't taken into account. The log keeps on being circularly written and overwritten in the 64KB RAM buffer.

The first part of /etc/config/system looks like this (Note is mine but now irrelevant: first-time install only detected half the RAM - i.e. 64 MB):

config system
        option hostname 'OpenWrt'
        option ttylogin '0'
        option log_size '64'
        option urandom_seed '0'
        option compat_version '1.1'
        option notes 'RAM not correctly detected.'
        option zonename 'America/Toronto'
        option timezone 'EST5EDT,M3.2.0,M11.1.0'
        option log_proto 'udp'
        option conloglevel '8'
        option cronloglevel '5'
        option log_file '/mnt/sda/syslog.log'

What is the incorrect setting here?

Besides, it doesn't appear to be very verbose, despite being set at the "Debug" level (Second problem). Could this be yet another instance of https://forum.openwrt.org/t/logd-doesnt-honor-conloglevel-17-01-4-r3560-79f57e422d/8196? And, how do I get real debug logs?

I was not able to reproduce your problem. Adding a filename it started immediately to log.

root@magiatiko:[~]#la /tmp/system.log 
-rw-------    1 root     root         390 Apr 24 00:06 /tmp/system.log
root@magiatiko:[~]#la /tmp/system.log 
-rw-------    1 root     root         585 Apr 24 00:06 /tmp/system.log
root@magiatiko:[~]#tail /tmp/system.log 
Sun Apr 24 00:06:37 2022 daemon.err ospfd[22580]: [EC 100663299] *** sendmsg in ospf_write failed to 224.0.0.5, id 9355, off 0, len 64, interface elvetias, mtu 1420: Destination address required
Sun Apr 24 00:06:47 2022 daemon.err ospfd[22580]: [EC 100663299] *** sendmsg in ospf_write failed to 224.0.0.5, id 9356, off 0, len 64, interface elvetias, mtu 1420: Destination address required
Sun Apr 24 00:06:57 2022 daemon.err ospfd[22580]: [EC 100663299] *** sendmsg in ospf_write failed to 224.0.0.5, id 9357, off 0, len 64, interface elvetias, mtu 1420: Destination address required
Sun Apr 24 00:07:07 2022 daemon.err ospfd[22580]: [EC 100663299] *** sendmsg in ospf_write failed to 224.0.0.5, id 9358, off 0, len 64, interface elvetias, mtu 1420: Destination address required
Sun Apr 24 00:07:17 2022 daemon.err ospfd[22580]: [EC 100663299] *** sendmsg in ospf_write failed to 224.0.0.5, id 9359, off 0, len 64, interface elvetias, mtu 1420: Destination address required
root@magiatiko:[~]#uci export system
package system

config system
        option ttylogin '0'
        option urandom_seed '0'
        option log_proto 'udp'
        option hostname 'magiatiko'
        option timezone 'CET-1CEST,M3.5.0,M10.5.0/3'
        option zonename 'Europe/Prague'
        option description 'home router'
        option log_size '4096'
        option log_file '/tmp/system.log'
        option conloglevel '8'
        option cronloglevel '5'

My bad, it is indeed written to. But with about 15 devices on the network actively using it, there's no way these would be the only events in 35 minutes timeframe:

Sat Apr 23 17:46:52 2022 daemon.info dnsmasq-dhcp[3190]: DHCPREQUEST(br-lan) 192.168.1.103 48:e1:e9:3e:ae:d1
Sat Apr 23 17:46:52 2022 daemon.info dnsmasq-dhcp[3190]: DHCPACK(br-lan) 192.168.1.103 48:e1:e9:3e:ae:d1
Sat Apr 23 17:46:58 2022 daemon.notice netifd: wan (2744): udhcpc: sending renew to 70.aaa.xxx.yyy
Sat Apr 23 17:46:58 2022 daemon.notice netifd: wan (2744): udhcpc: lease of 38.aaa.xxx.yyy obtained, lease time 86400
Sat Apr 23 17:46:58 2022 user.notice firewall: Reloading firewall due to ifupdate of wan (internet)

…Which brings me to Problem nº 2: how do I get real debug-level logging?

Thanks for help

Which server do you want to debug? You need to enable debug on the individual server. The debug level in system config file is more for the system.

1 Like

An interesting update (I hope!)
I had an older router running Gargoyle 1.13 that I simply dropped in place of the Linksys EA4500.
WD My Net N600 running Gargoyle 1.12, based on OpenWRT 19.07 (stock config)
-> no bug!
Linksys EA4500 running OpenWRT 21.02 (updates applied)
-> disconnects all network on calling (received and made) through Teams, but there's a dearth of logs...

In the absence of detailed logs, what could have changed between those to trigger such a crippling bug?

I never said that I wanted to debug any server. -> wrong topic?