journalctl

Aus Mikiwiki
Version vom 7. November 2020, 22:29 Uhr von Michi (Diskussion | Beiträge) (Die Seite wurde neu angelegt: «Der Shell-Befehl <b>journalctl</b> wird zum Lesen der Logdateien des systemd verwendet. == Verwendung == Ansehen aller Logeinträge. # <b>journalctl<…»)
(Unterschied) ← Nächstältere Version | Aktuelle Version (Unterschied) | Nächstjüngere Version → (Unterschied)
Wechseln zu: Navigation, Suche

Der Shell-Befehl journalctl wird zum Lesen der Logdateien des systemd verwendet.

Inhaltsverzeichnis

Verwendung

Ansehen aller Logeinträge.

# journalctl
-- Logs begin at Sat 2020-10-24 12:14:51 CEST, end at Sat 2020-11-07 22:17:01 CE
Okt 24 12:14:51 kuhn4 kernel: Linux version 4.19.0-11-amd64 (debian-kernel@lists
Okt 24 12:14:51 kuhn4 kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-4.19.0-11-a
Okt 24 12:14:51 kuhn4 kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floa
Okt 24 12:14:51 kuhn4 kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE regi
Okt 24 12:14:51 kuhn4 kernel: x86/fpu: Supporting XSAVE feature 0x004: 'AVX regi
Okt 24 12:14:51 kuhn4 kernel: x86/fpu: Supporting XSAVE feature 0x008: 'MPX boun
Okt 24 12:14:51 kuhn4 kernel: x86/fpu: Supporting XSAVE feature 0x010: 'MPX CSR'
Okt 24 12:14:51 kuhn4 kernel: x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]: 
...

Ansehen der Logeinträge eines bestimmten Dienstes (hier "apache2").

# journalctl -u apache2.service
-- Logs begin at Sat 2020-10-24 12:14:51 CEST, end at Sat 2020-11-07 22:17:01 CE
Okt 24 12:14:53 kuhn4 systemd[1]: Starting The Apache HTTP Server...
Okt 24 12:14:53 kuhn4 systemd[1]: Started The Apache HTTP Server.
Okt 25 00:00:30 kuhn4 systemd[1]: Reloading The Apache HTTP Server.
Okt 25 00:00:30 kuhn4 systemd[1]: Reloaded The Apache HTTP Server.
Okt 25 03:16:28 kuhn4 systemd[1]: Stopping The Apache HTTP Server...
Okt 25 03:16:28 kuhn4 systemd[1]: apache2.service: Succeeded.
...

Ansehen der Logeinträge seit dem letzten Neustart.

# journalctl --boot
-- Logs begin at Sat 2020-10-24 12:14:51 CEST, end at Sat 2020-11-07 22:17:01 CE
Nov 07 09:11:21 kuhn4 kernel: Linux version 4.19.0-12-amd64 (debian-kernel@lists
Nov 07 09:11:21 kuhn4 kernel: Command line: BOOT_IMAGE=/boot/vmlinuz-4.19.0-12-a
Nov 07 09:11:21 kuhn4 kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floa
Nov 07 09:11:21 kuhn4 kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE regi
Nov 07 09:11:21 kuhn4 kernel: x86/fpu: Supporting XSAVE feature 0x004: 'AVX regi
Nov 07 09:11:21 kuhn4 kernel: x86/fpu: Supporting XSAVE feature 0x008: 'MPX boun
Nov 07 09:11:21 kuhn4 kernel: x86/fpu: Supporting XSAVE feature 0x010: 'MPX CSR'
Nov 07 09:11:21 kuhn4 kernel: x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]: 
Nov 07 09:11:21 kuhn4 kernel: x86/fpu: xstate_offset[3]:  832, xstate_sizes[3]: 

Um das Ende aller Logeinträge oder Logeinträge eines bestimmten Dienstes anzusehen.

# journalctl -f
# journalctl -u apache2.service -f

Weblinks