Editing Journalctl
Jump to navigation
Jump to search
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
− | |||
<code>journalctl</code> command allows to query the contents of the [[systemd]] journal/[[logs]]. | <code>journalctl</code> command allows to query the contents of the [[systemd]] journal/[[logs]]. | ||
== Configuration == | == Configuration == | ||
− | * <code>[[/etc/systemd/journald.conf]]</code> | + | * <code>[[/etc/systemd/]][[journald.conf]]</code> |
== Basic Commands == | == Basic Commands == | ||
− | * <code>journalctl</code><ref>https://www.freedesktop.org/software/systemd/man/journalctl.html</ref> or <code>journalctl -- | + | * <code>journalctl</code><ref>https://www.freedesktop.org/software/systemd/man/journalctl.html</ref> or <code>journalctl --no-pager</code> |
− | * <code> | + | * <code>journalctl -r</code> (reverse order) |
* <code>journalctl -k</code>: Show only [[kernel]] messages | * <code>journalctl -k</code>: Show only [[kernel]] messages | ||
− | * <code> | + | * <code>journalctl -f</code> (follow) |
* <code>[[journalctl -u]] [[service-name]].service</code> | * <code>[[journalctl -u]] [[service-name]].service</code> | ||
:: <code>-u unit_name</code> | :: <code>-u unit_name</code> | ||
Line 16: | Line 15: | ||
::: <code>journalctl -u [[sshd|ssh]]</code> (See also [[sshd logs]]) | ::: <code>journalctl -u [[sshd|ssh]]</code> (See also [[sshd logs]]) | ||
::: <code>[[journalctl -u docker]]</code> | ::: <code>[[journalctl -u docker]]</code> | ||
− | |||
− | |||
* <code>[[journalctl --verify]]</code> | * <code>[[journalctl --verify]]</code> | ||
− | + | Disk Usage/Logging: | |
− | |||
− | |||
* <code>[[journalctl --disk-usage]]</code> | * <code>[[journalctl --disk-usage]]</code> | ||
* <code>journalctl --vacuum-time=2d</code> | * <code>journalctl --vacuum-time=2d</code> | ||
− | * <code> | + | * <code>journalctl --vacuum-size=200M</code><ref>https://askubuntu.com/a/1012913</ref> |
**--vacuum-size=BYTES Reduce disk usage below specified size | **--vacuum-size=BYTES Reduce disk usage below specified size | ||
**--vacuum-files=INT Leave only the specified number of journal files | **--vacuum-files=INT Leave only the specified number of journal files | ||
− | ** | + | **--vacuum-time=TIME Remove journal files older than specified time |
− | * <code>journalctl --list-boots</code>. See also: <code> | + | * <code>journalctl --list-boots</code>. See also: <code>last (command)</code> |
* <code>journalctl -xb</code> | * <code>journalctl -xb</code> | ||
:<code>-x --catalog</code> Includes explanations in log lines from [[message catalgog]] | :<code>-x --catalog</code> Includes explanations in log lines from [[message catalgog]] | ||
− | :<code>-b </code> show message from current | + | :<code>-b </code> show message from current boot. if [ID] is provided will show messages from that specific [[boot]]. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
== Activities == | == Activities == | ||
− | * Review [[ | + | * Review [[Libvirt error messages in journald]] |
+ | * Review [[No space left on device]] messages | ||
==See also== | ==See also== | ||
Line 50: | Line 38: | ||
* {{journalctl}} | * {{journalctl}} | ||
* {{systemd}} | * {{systemd}} | ||
+ | * <code>/etc/[[inittab]]</code><ref>https://linux.die.net/man/5/inittab</ref> and <code>respawn</code> option<ref>https://superuser.com/questions/507576/how-to-automatically-restart-a-linux-background-process-if-it-fails</ref> | ||
* [[launchd]] init and operating system service management daemon for [[MacOS]] | * [[launchd]] init and operating system service management daemon for [[MacOS]] | ||
* {{logging}} | * {{logging}} | ||
Line 59: | Line 48: | ||
[[Category:Linux]] | [[Category:Linux]] | ||
[[Category:Systemd]] | [[Category:Systemd]] | ||
− |
Advertising: