Journalctl: Difference between revisions

From DikapediaV2
Jump to: navigation, search
(Created page with "journalctl --no-pager --catalog --boot")
 
No edit summary
Line 1: Line 1:
journalctl --no-pager --catalog --boot
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 <b>/var/log/journalctl/*</b>. 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

Revision as of 17:07, 2 September 2024

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