How to get all the logs with journalctl#

The command journalctl can be used to get the logs of a single service, the logs of the kernel and the logs of the system.

Logs for a service:#

If there is a systemd service on the target, the logs can be retrieved using this command:

journalctl -u <service_name>

For example, if the service hello_world is on the target, its logs can be retrieved using:

root@sm2s-imx8nano:~# journalctl -u hello_world.service
Nov 28 07:56:58 sm2s-imx8nano systemd[1]: Started Hello World.
Nov 28 07:56:58 sm2s-imx8nano echo[1194]: Hello World
Nov 28 07:56:58 sm2s-imx8nano systemd[1]: hello_world.service: Deactivated successfully.
Nov 28 07:58:01 sm2s-imx8nano systemd[1]: Started Hello World.
Nov 28 07:58:01 sm2s-imx8nano echo[1203]: Hello World
Nov 28 07:58:01 sm2s-imx8nano systemd[1]: hello_world.service: Deactivated successfully.
Nov 28 07:59:07 sm2s-imx8nano systemd[1]: Started Hello World.
Nov 28 07:59:07 sm2s-imx8nano echo[1217]: Hello World
Nov 28 07:59:07 sm2s-imx8nano systemd[1]: hello_world.service: Deactivated successfully.

Logs for the kernel:#

The logs of the kernel can be retrieved using this command:

journalctl -k

Here is an example of the kernel logs:

root@sm2s-imx8nano:~# journalctl -k
Nov 28 07:42:58 sm2s-imx8nano kernel: Booting Linux on physical CPU 0x0000000000 [0x410fd034]
Nov 28 07:42:58 sm2s-imx8nano kernel: Linux version 6.6.23 (oe-user@oe-host) (aarch64-simplecoredistro-linux-gcc (GCC) 13.4.0, GNU ld (GNU Binutils) 2.42.0.20240723) #1 SMP PREEMPT Fri Mar 21 12:43:10 UTC 2025
Nov 28 07:42:58 sm2s-imx8nano kernel: KASLR enabled
Nov 28 07:42:58 sm2s-imx8nano kernel: Machine model: MSC SM2S-IMX8MN
Nov 28 07:42:58 sm2s-imx8nano kernel: earlycon: ec_imx6q0 at MMIO 0x0000000030860000 (options '115200')
Nov 28 07:42:58 sm2s-imx8nano kernel: printk: bootconsole [ec_imx6q0] enabled
Nov 28 07:42:58 sm2s-imx8nano kernel: Reserved memory: created CMA memory pool at 0x0000000058000000, size 640 MiB
Nov 28 07:42:58 sm2s-imx8nano kernel: OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
Nov 28 07:42:58 sm2s-imx8nano kernel: OF: reserved mem: 0x0000000058000000..0x000000007fffffff (655360 KiB) map reusable linux,cma
Nov 28 07:42:58 sm2s-imx8nano kernel: NUMA: No NUMA configuration found
...

Logs for the system:#

The logs of the system can be retrieved using:

journalctl --system

Here is an example of the system logs:

root@sm2s-imx8nano:~# journalctl --system
Nov 28 07:42:58 sm2s-imx8nano kernel: Booting Linux on physical CPU 0x0000000000 [0x410fd034]
Nov 28 07:42:58 sm2s-imx8nano kernel: Linux version 6.6.23 (oe-user@oe-host) (aarch64-simplecoredistro-linux-gcc (GCC) 13.4.0, GNU ld (GNU Binutils) 2.42.0.20240723) #1 SMP PREEMPT Fri Mar 21 12:43:10 UTC 2025
Nov 28 07:42:58 sm2s-imx8nano kernel: KASLR enabled
Nov 28 07:42:58 sm2s-imx8nano kernel: Machine model: MSC SM2S-IMX8MN
Nov 28 07:42:58 sm2s-imx8nano kernel: earlycon: ec_imx6q0 at MMIO 0x0000000030860000 (options '115200')
Nov 28 07:42:58 sm2s-imx8nano kernel: printk: bootconsole [ec_imx6q0] enabled
Nov 28 07:42:58 sm2s-imx8nano kernel: Reserved memory: created CMA memory pool at 0x0000000058000000, size 640 MiB
Nov 28 07:42:58 sm2s-imx8nano kernel: OF: reserved mem: initialized node linux,cma, compatible id shared-dma-pool
Nov 28 07:42:58 sm2s-imx8nano kernel: OF: reserved mem: 0x0000000058000000..0x000000007fffffff (655360 KiB) map reusable linux,cma
Nov 28 07:42:58 sm2s-imx8nano kernel: NUMA: No NUMA configuration found
...
Nov 28 07:42:58 sm2s-imx8nano systemd[1]: systemd 255.21^ running in system mode (+PAM -AUDIT -SELINUX -APPARMOR +IMA -SMACK +SECCOMP -GCRYPT -GNUTLS -OPENSSL +ACL +BLKID -CURL -ELFUTILS -FIDO2 -IDN2 -IDN -IPTC +KMOD -LIBCRYPTSETUP +LIBFDISK -PCRE2 -PWQUALITY -P11KIT -QRENCODE -TPM2 -BZIP2 -LZ4 -XZ -ZLIB +ZSTD -BPF_FRAMEWORK +XKBCOMMON +UTMP +SYSVINIT default-hierarchy=unified)
Nov 28 07:42:58 sm2s-imx8nano systemd[1]: Detected architecture arm64.
Nov 28 07:42:58 sm2s-imx8nano systemd[1]: Hostname set to <sm2s-imx8nano>.
Nov 28 07:42:58 sm2s-imx8nano systemd[1]: Using hardware watchdog 'rn5t618-wdt', version 0, device /dev/watchdog0
Nov 28 07:42:58 sm2s-imx8nano systemd[1]: Watchdog running with a hardware timeout of 32s.
Nov 28 07:42:58 sm2s-imx8nano systemd[1]: /etc/systemd/system/weston.socket.d/weston-socket-simplecore.conf:4: Failed to parse mode value, ignoring:
Nov 28 07:42:58 sm2s-imx8nano systemd[1]: Queued start job for default target Graphical Interface.
Nov 28 07:42:58 sm2s-imx8nano systemd[1]: Created slice Slice /session.
Nov 28 07:42:58 sm2s-imx8nano systemd[1]: Created slice Slice /system/getty.
Nov 28 07:42:58 sm2s-imx8nano systemd[1]: Created slice Slice /system/modprobe.
...