Difference between revisions of "Journalctl"

From wikieduonline
Jump to navigation Jump to search
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{lowercase}}
 
<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]].
  
Line 6: Line 7:
 
== Basic Commands ==
 
== Basic Commands ==
 
* <code>journalctl</code><ref>https://www.freedesktop.org/software/systemd/man/journalctl.html</ref> or <code>journalctl --[[no-pager]]</code>
 
* <code>journalctl</code><ref>https://www.freedesktop.org/software/systemd/man/journalctl.html</ref> or <code>journalctl --[[no-pager]]</code>
* <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)
Line 15: Line 16:
 
::: <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 -u prometheus]]</code>
 
::: <code>journalctl -u UNIT_NAME -n 1 -o verbose</code>
 
::: <code>journalctl -u UNIT_NAME -n 1 -o verbose</code>
  
 
* <code>[[journalctl --verify]]</code>
 
* <code>[[journalctl --verify]]</code>
  
 +
[[journalctl -xn --nopager]]
  
 
[[Disk Usage]]/Logging:  
 
[[Disk Usage]]/Logging:  
Line 26: Line 29:
 
**--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
+
**[[--vacuum-time]]=TIME    Remove journal files older than specified time
 
* <code>journalctl --list-boots</code>. See also: <code>[[last (command)]]</code>
 
* <code>journalctl --list-boots</code>. See also: <code>[[last (command)]]</code>
 
* <code>journalctl -xb</code>
 
* <code>journalctl -xb</code>

Latest revision as of 12:05, 28 September 2023

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

Configuration[edit]

Basic Commands[edit]

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

Disk Usage/Logging:

-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[edit]

Activities[edit]

See also[edit]

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: