My PiFi device refused to create its Wi-Fi network, leaving me with no way to connect and troubleshoot the issue. I was stuck. I didn’t want to factory reset the device before understanding what went wrong (and actually no longer had a way to factory reset, but that’s a different story). Even when I eventually managed to get it running after three restarts, I realized that commands like logread and dmesg only showed logs from the current boot session. By that time, I had lost all the valuable information about the previous failures, and I had no way of determining what had caused the problem in the first place.
The Solution: External Syslog Server
To ensure you have access to older logs, the best solution is to forward your logs to an external syslog server. There are two main ways to achieve this:
- Docker-based Syslog-ng:
You can install a Docker container running syslog-ng on your network (on a different computer on the network, not on the PiFi device). This container acts as a centralized syslog server, receiving logs from your OpenWrt device. - Built-in Syslog Server on Unraid:
Alternatively, I opted to use the built-in syslog server on my Unraid server.
Either approach works, but the key is that you should have another computer on your network that can receive and store the logs. Alternatively, you can plug a small USB thumb drive and have the logs persist there, I didn’t have one to spare, maybe I’ll do that as well in the future.
Setting Up Your Syslog Server
While configuring your syslog server, you need to decide on a location—a “syslog folder”—where all incoming log files will be saved. In my setup, I created a folder with SMB access so that I can easily access and review the logs from any computer on the network.
My syslog server was configured to listen on port 514 (the default for syslog). Once the server was ready, all I had to do was log into my OpenWrt’s LuCI interface and navigate to:
LuCI → System → System → Logging
Under the “External System Log Server” section, I simply entered the IP address of my Unraid machine (for example, 192.168.1.69).
Testing the Setup
After setting everything up, testing was straightforward. From an SSH session on the PiFi device, I ran:
logger "test message"
This command sends a test log message to the external syslog server. I then checked my designated syslog folder on my network, and sure enough, the “test message” was recorded in one of the log files.
And there you have it, even if my PiFi device now crashes or reboots, I will still have its last thoughts before it gave up and crashed…