journal is used by systemd as a centralized log management system for all kernel and userland processes.
The main command to use journal
journalctl
Filter logs by systemd
service
journalctl -u nginx.service
Delete oldest logs first until the specified size is met
sudo journalctl --vacuum-size=1G
sudo journalctl --vacuum-size=100M
Delete logs that are not within the specified time range
sudo journalctl --vacuum-time=1years
sudo journalctl --vacuum-time=7d
/etc/systemd/journald.conf
The following items can be used to limit the journal growth:
SystemMaxUse=
: Specifies the maximum disk space that can be used by the journal in persistent storage.SystemKeepFree=
: Specifies the amount of space that the journal should leave free when adding journal entries to persistent storage.SystemMaxFileSize=
: Controls how large individual journal files can grow to in persistent storage before being rotated.RuntimeMaxUse=
: Specifies the maximum disk space that can be used in volatile storage (within the /run
filesystem).RuntimeKeepFree=
: Specifies the amount of space to be set aside for other uses when writing data to volatile storage (within the /run
filesystem).RuntimeMaxFileSize=
: Specifies the amount of space that an individual journal file can take up in volatile storage (within the /run
filesystem) before being rotated.