什么是journal log
它是一个binary格式的集中存放的Linux系统下的log文件
Journal is a component of systemd. It capture log messages of kernel logs, syslog messages, or error log messages. It collect them, index them and makes availabe to the users. Journal are stored in /run/log/journal directory.
查看它需要使用journalctl命令
查看所有的日志,可以像vim那样查找
/string Search string
n/N Go to the next or previous search match
# journalctl
Show journal logs in real time
# journalctl -f
Show only kernel messages with -k
# journalctl -k
Show messages from a particular boot session
Boot session 0 is the current boot sessions. Boot session -1 is the last booted session and so on.
# journalctl --list-boots
-43 17f2c61e342a44a89c567e9510bea25f Fri 2021-05-28 16:42:51 CST—Fri 2021-05-28 17:38:01 CST
-42 6977276106c84cc5ab045f397f2e8245 Sun 2021-05-30 20:11:43 CST—Sun 2021-05-30 21:41:48 CST
-41 46565d4eab8e4ed393b6f11c3d83dbf2 Mon 2021-05-31 08:58:32 CST—Mon 2021-05-31 12:33:19 CST
-40 15c05936fae149cda62aea893faa95bc Mon 2021-05-31 15:32:29 CST—Mon 2021-05-31 16:11:04 CST
-39 ed7a012dd01e4e4e9eba9c42443ba950 Mon 2021-05-31 16:12:27 CST—Mon 2021-05-31 17:30:18 CST
-38 24d5c0a5686040178cc6be597c8ac68b Tue 2021-06-01 08:49:30 CST—Tue 2021-06-01 17:08:17 CST
-37 b9de4023663a4ddc91e32a3152f59150 Wed 2021-06-02 09:29:46 CST—Wed 2021-06-02 09:54:48 CST
-36 1c4bef3ee60a4e0db130002d8da318f3 Wed 2021-06-02 10:10:48 CST—Wed 2021-06-02 19:45:24 CST
-35 b2080723d2f843a6ac86a96ec7ff6a47 Thu 2021-06-03 09:17:48 CST—Thu 2021-06-03 10:32:00 CST
-34 0b531c026ad1408498313585a5295f9f Thu 2021-06-03 10:33:04 CST—Thu 2021-06-03 14:30:01 CST
-33 c1bc4dbe574c40faa5975e04bf4c3871 Thu 2021-06-03 14:30:08 CST—Thu 2021-06-03 14:40:10 CST
-32 d38e64d69d574963914db88d3141c32d Thu 2021-06-03 14:40:19 CST—Thu 2021-06-03 16:06:20 CST
-31 cb3dd42f6967417eb00244ab326df6c3 Thu 2021-06-03 16:06:23 CST—Thu 2021-06-03 22:00:09 CST
-30 ec70ddbe818a4a2191900179ee78f341 Fri 2021-06-04 09:16:53 CST—Fri 2021-06-04 10:28:50 CST
-29 b5a3b0b4543e4265ba6883ee7722c980 Fri 2021-06-04 10:30:10 CST—Fri 2021-06-04 10:35:48 CST
-28 58ad2452ab6c4a7c844a896c82eefa6f Fri 2021-06-04 10:37:17 CST—Fri 2021-06-04 10:40:28 CST
-27 134f55c4e84c4e24ab756156db57f77e Fri 2021-06-04 10:41:59 CST—Fri 2021-06-04 10:53:41 CST
-26 e6d2e221096f47be864d2d416c58de09 Fri 2021-06-04 10:54:17 CST—Fri 2021-06-04 11:20:02 CST
-25 06d94651e59744f5976a8ae230d6c100 Fri 2021-06-04 11:20:03 CST—Fri 2021-06-04 13:25:03 CST
-24 85f19ee4b5d54324a3cbea961b945ca8 Fri 2021-06-04 13:25:07 CST—Fri 2021-06-04 13:58:57 CST
-23 f869009224c5499db4f14206469075db Fri 2021-06-04 13:59:27 CST—Fri 2021-06-04 14:21:21 CST
-22 7b994d19154b45838520963b16adb532 Fri 2021-06-04 14:23:37 CST—Fri 2021-06-04 15:23:32 CST
-21 d0e67cd0d9054b52af6ca57698b5b634 Fri 2021-06-04 15:23:33 CST—Fri 2021-06-04 16:18:02 CST
-20 03ffb28a45974672a996550b1bff6093 Fri 2021-06-04 16:18:02 CST—Fri 2021-06-04 19:39:12 CST
-19 c5f4ad2cce0543e8a3b7b382d32a37da Fri 2021-06-04 19:39:27 CST—Fri 2021-06-04 21:08:07 CST
-18 b36d2b00631840ec971f8c52e38238cc Sun 2021-06-06 17:25:54 CST—Sun 2021-06-06 18:08:40 CST
-17 26ac62527c754886bc84aa3a9ec190cd Mon 2021-06-07 11:09:41 CST—Mon 2021-06-07 14:39:45 CST
-16 bfb6cc8bfda0496a9d1e16159a7a4958 Mon 2021-06-07 14:40:05 CST—Mon 2021-06-07 14:51:49 CST
-15 7d9d2ebd37564d008de2e70ca4d9da25 Mon 2021-06-07 16:32:24 CST—Mon 2021-06-07 17:18:17 CST
-14 f30bf891384244baa10f7d7bf259281c Wed 2021-06-09 11:02:01 CST—Wed 2021-06-09 17:17:18 CST
-13 ea16fce0e142448e916490bc52dd62f0 Thu 2021-06-10 10:41:29 CST—Thu 2021-06-10 13:31:52 CST
-12 6c36badd861644abbe582e0cfe9422cd Thu 2021-06-10 13:31:53 CST—Thu 2021-06-10 14:37:24 CST
-11 578386beb45d4bae802d35c0bb9a841d Thu 2021-06-10 14:37:27 CST—Fri 2021-06-11 08:58:35 CST
-10 68fc7dda0cda48a3ba14899836048848 Fri 2021-06-11 09:29:12 CST—Fri 2021-06-11 15:31:11 CST
-9 dc18baffe3b24345b8844281eca84b91 Fri 2021-06-11 15:32:45 CST—Fri 2021-06-11 17:35:12 CST
-8 4dd5480650a64a4f92b0e31de5ec000d Mon 2021-06-14 15:07:36 CST—Mon 2021-06-14 17:39:13 CST
-7 6db4f9e5d2a54300a4fb58312a7bdbb8 Mon 2021-06-14 17:41:02 CST—Mon 2021-06-14 19:24:08 CST
-6 29d739ba7702485c950251110a4933f6 Mon 2021-06-14 19:24:09 CST—Mon 2021-06-14 19:39:01 CST
-5 dfcdefc6b17c4735a5275cd129e5397c Mon 2021-06-14 19:39:01 CST—Mon 2021-06-14 19:42:09 CST
-4 8c00fdda39fd4542b073e014cfdafabe Mon 2021-06-14 19:42:09 CST—Mon 2021-06-14 19:54:23 CST
-3 adef8c7a9e864f10b025396774cc3c8f Mon 2021-06-14 19:55:48 CST—Mon 2021-06-14 19:58:11 CST
-2 fe9b3e338235426ca4cf9c40348db725 Tue 2021-06-15 09:08:34 CST—Tue 2021-06-15 10:21:47 CST
-1 97e06872178a419b9f4dd732f20a0c4d Tue 2021-06-15 10:32:50 CST—Tue 2021-06-15 13:35:24 CST
0 b21eec435c914184bce30ade61079643 Wed 2021-06-16 10:54:58 CST—Wed 2021-06-16 13:30:41 CST
# journalctl -b -2
https://linuxhandbook.com/journalctl-command/
https://blog.csdn.net/VillianTsang/article/details/103274830