I don't understand why the /var/log/journal/
folder is so big.
For example, by executing the command systemctl -f
, i see the fill.
If I click on an email on Thunderbird, it generates dozens of lines that I consider useless.
Currently, I have more than 1.5GB (du -h /var/log/journal/
) generated in 1 day!
Is there a method to reduce this log considerably without stopping logging?
You can diminish the size of the journal by means of these commands:
This will retain the most recent 100M of data.
will delete everything but the last 10 days.
From
man journalctl
:As @kurt-fitzner wrote:
More specifically: Activate the
SystemMaxUse=
option there, e.g. asSystemMaxUse=100M
to only use 100 MB.After editing, use
service systemd-journald restart
to activate the changed configuration. This will remove the excess logs.journald.conf also has other options that might be useful.
You also need to set this in
/etc/systemd/journald.conf
:See: https://got-tty.org/journalctl-via-journald-conf-die-loggroesse-definieren (in German)
Reading this was confused about SystemMaxFileSize vs SystemMaxUse options for journald.conf. This clears it up:
SystemMaxUse= and RuntimeMaxUse= control how much disk space the journal may use up at most. SystemKeepFree= and RuntimeKeepFree= control how much disk space systemd-journald shall leave free for other uses. systemd-journald will respect both limits and use the smaller of the two values.
The first pair defaults to 10% and the second to 15% of the size of the respective file system, but each value is capped to 4G. If the file system is nearly full and either SystemKeepFree= or RuntimeKeepFree= are violated when systemd-journald is started, the limit will be raised to the percentage that is actually free. This means that if there was enough free space before and journal files were created, and subsequently something else causes the file system to fill up, journald will stop using more space, but it will not be removing existing files to reduce the footprint again, either. Also note that only archived files are deleted to reduce the space occupied by journal files. This means that, in effect, there might still be more space used than SystemMaxUse= or RuntimeMaxUse= limit after a vacuuming operation is complete.
SystemMaxFileSize= and RuntimeMaxFileSize= control how large individual journal files may grow at most. This influences the granularity in which disk space is made available through rotation, i.e. deletion of historic data. Defaults to one eighth of the values configured with SystemMaxUse= and RuntimeMaxUse=, so that usually seven rotated journal files are kept as history.