I am using journalctl for logging, it appears to be only keeping logs for 1 hour, how can I force it to keep 30 days of logs?
1 Answer
Double check your journald.conf
file. Probably you are not using defaults values for SystemMaxUse
or MaxFileSec
. If you want 30 days of logs, use MaxFileSec=30day
. Then restart the journal with systemctl restart systemd-journald
Also check how much space you are using for logs at the moment with journalctl --disk-usage
and how much free space you have in your disk df -lh
. Perhaps if you have little free space, that is triggering a vacuuming operation.