Difference between revisions of "Journalctl"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Tags: Mobile web edit, Mobile edit
Line 8: Line 8:
 
* <code>journalctl -r</code> (reverse order)
 
* <code>journalctl -r</code> (reverse order)
 
* <code>journalctl -k</code>: Show only [[kernel]] messages
 
* <code>journalctl -k</code>: Show only [[kernel]] messages
* <code>journalctl -f</code> (follow)
+
* <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>

Revision as of 13:21, 13 April 2021

journalctl command allows to query the contents of the systemd journal/logs.

Configuration

Basic Commands

-u unit_name
journalctl -u service-name.service -f
journalctl -u libvirtd
journalctl -u ssh (See also sshd logs)
journalctl -u docker
journalctl -u UNIT_NAME -n 1 -o verbose

Disk Usage/Logging:

  • journalctl --disk-usage
  • journalctl --vacuum-time=2d
  • journalctl --vacuum-size=200M[2]
    • --vacuum-size=BYTES Reduce disk usage below specified size
    • --vacuum-files=INT Leave only the specified number of journal files
    • --vacuum-time=TIME Remove journal files older than specified time
  • journalctl --list-boots. See also: last (command)
  • journalctl -xb
-x --catalog Includes explanations in log lines from message catalgog
-b show message from current boot. if [ID] is provided will show messages from that specific boot.


  • journalctl --since "2 days ago"

Related terms

Activities

See also

Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy.

Source: https://en.wikiversity.org/wiki/Linux_Administration/System_Services/System_Logging/Journalctl

Advertising: