After power loss and reboot, the logs from a few minutes before the failure can no longer be found. If the router stores logs only in memory within a ring buffer, they will be cleared upon reboot; even without reboot, continuous new logs will overwrite older ones. To investigate across reboots, first determine where the logs should be stored.
Use a tagged message to confirm destination.
uci show system | grep -E 'log_(size|file|ip|port|proto)'
logger -t gm-log-check 'single test record'
logread -e gm-log-check
The local system can detect this entry, which only proves it entered the current logging chain. When log_file is configured, verify the same marker at the actual mounted location of the file. /tmp is typically in memory; the existence of a file does not imply persistent storage. If a remote destination is configured, on the receiving end, search by hostname, timestamp, and label for the same line, then verify the transport protocol and port.
Select save method based on fault
Just monitor current services using memory buffering; for unattended on-site scenarios, check power-off prior records, prioritize reliable remote or mounted data disks, and set retention periods. When the external network is not reachable during early boot, remote endpoints might miss the earliest messages. Before changing the log destination, preserve the original configuration and verify after testing that local maintenance access still allows log viewing. Searching for a recently written marker is easier than fully restarting the router for pinpointing where the failure occurred.
Reference
Related guide · Verify router identity and timestamps in centralized OpenWrt logs
Comments