Introduction
By default Torizon only keeps system logs in memory, with /var/log being located in /var/volatile/logs. This article describes the configuration to make logging persistent, and how to avoid filling the root storage.
Note: persistent logging will cause more writes to flash which will lower the lifespan of the flash memory. Make sure you understand the limitations of flash memory before enabling this configuration!
Configuration
You must first disable the temporary logs configuration and remove the symbolic link from /var. Then you must create the /var/log folder and, optionally, the /var/log/journal which will cause journald to save logs as well.
sudo sed -i '/\/var\/volatile\/log/d' /etc/tmpfiles.d/00-create-volatile.conf
sudo rm /var/log
sudo mkdir -p /var/log/journal
Limit Journal Size
If you created /var/log/journal it is a good idea to configure a limit on the storage size. This can be done by editing /etc/systemd/journald.conf and enabling this line, adjust 4G to meet your needs.
SystemMaxUse=4G
Comments
0 comments
Please sign in to leave a comment.