Persisting logs
Persistent logging has been significantly improved in version 1.3. You may consider upgrading if you need it.
If you have to diagnose some configuration troubles, it may sometimes be interesting to persist the logs over reboot. This can be done by changing the location of the logs to the internal flash memory.
Logging to the flash memory will decrease the memory's lifespan. You should do this only temporary for diagnose purpose. The lifespan reduction will depend on the amount of logging.
If you change the logging destination to make it persistent, these logs will not be shown through the Manager web interface.
You can do so through the CLI either with the following quick setup or by following the step-by-step guide:
Run this script in the gateway CLI terminal:
You should see the following output in the last line:
If it's not the case, please use the step-by-step guide on the other tab.
To persist the logs, edit the syslogd
configuration /etc/conf.d/busybox-syslogd
. Here is the default content of this file:
nano /etc/conf.d/busybox-syslogd
By default, the logs are stored to /var/log/messages
. We can change this by adding the -O
(upper case o, not zero) arguments to store them in /var/log-persistent/messages
:
nano /etc/conf.d/busybox-syslogd
Save the file.
Create the new folder that we just specified:
The, restart syslogd:
Output
You can test the new logging location by logging a message manually:
And check that the message has been written to the logs with:
Output
This configuration is persistent over reboot. To revers the change, remove the -O argument and restart syslog.