Journalctl

From DikapediaV2
Revision as of 17:07, 2 September 2024 by Ardika Sulistija (talk | contribs)
Jump to: navigation, search

journalctl --no-pager --catalog --boot


Journalctl Disk Usage


Check Journalctl disk usage:

[ec2-user@ringroadlimo ~]$ journalctl --disk-usage
Archived and active journals take up 1.0G on disk.

Journalctl will take up space over time in the directory /var/log/journalctl/*. It is safe to delete the contents but do not delete the directory.

You can control the size of this directory using this parameter in your /etc/systemd/journald.conf:

SystemMaxUse=50M

To clean logs after a period of time rather than when they reach a certain size, you can set the parameter MaxRetentionSec instead of SystemMaxUse. See man journald.conf for more details.

You can force a log rotation:

$ sudo systemctl kill --kill-who=main --signal=SIGUSR2 systemd-journald.service

NOTE: You might need to restart the logging service to force a log rotation, if the above signaling method does not do it. You can restart the service like so:

$ sudo systemctl restart systemd-journald.service

Reference: https://unix.stackexchange.com/questions/130786/can-i-remove-files-in-var-log-journal-and-var-cache-abrt-di-usr