ããããå¤ãã®ç°å¢ã systemd ã«ãªã£ããã¨æãã¾ã。
systemd ç°å¢ã§ã¯ syslog ã logrotate ã systemd-journald ã§ç®¡çãããããã«ãªã£ã¦ãã,journalctl ã使ãã¨ä¾¿å©ã«ãã°ãçºãããã¾ã。
ç§ã¯ systemd ç°å¢ã主ã«ä½¿ãåºã㦠6 å¹´ãããã«ãªãã®ã§ããéä¸ã«ãªãã·ã§ã³å¢ãããã³ãã³ãå¢ãããè²ã ããã¾ãã。ãããªããã§,journalctl ã³ãã³ãã使ãã¨ãã®ä¾¿å©ãªãªãã·ã§ã³ã¨ãã®ã¡ã¢,ãã£ã¦ã¿ãã¼
ã¡ãªã¿ã«ã§ãã,
systemd ç°å¢ã§ã¯ syslog ã logrotate ã systemd-journald ã§ç®¡çãããããã«ãªã£ã¦ãã,journalctl ã使ãã¨ä¾¿å©ã«ãã°ãçºãããã¾ã。
ç§ã¯ systemd ç°å¢ã主ã«ä½¿ãåºã㦠6 å¹´ãããã«ãªãã®ã§ããéä¸ã«ãªãã·ã§ã³å¢ãããã³ãã³ãå¢ãããè²ã ããã¾ãã。ãããªããã§,journalctl ã³ãã³ãã使ãã¨ãã®ä¾¿å©ãªãªãã·ã§ã³ã¨ãã®ã¡ã¢,ãã£ã¦ã¿ãã¼
ãã¼ã ID ã®ä¸è¦§ã¨ç¹å®ã®èµ·åæã®ãã°ã®è¡¨ç¤º
$ journalctl --list-boot
-5 f5b4ff9349204d31b7c89cae00a765e5 Fri 2018-06-01 12:32:20 JST—Fri 2018-06-01 12:33:43 JST
-4 1baea4095c424e6b8f50f3eff1af2161 Fri 2018-06-01 12:34:21 JST—Fri 2018-06-01 12:35:17 JST
-3 dfb54ab05bd14c05ae83f4a767492293 Fri 2018-06-01 12:38:43 JST—Fri 2018-06-01 12:40:28 JST
-2 336d9d0421ce44d59aadcaf2de634e92 Fri 2018-06-01 12:50:57 JST—Tue 2018-06-05 10:15:33 JST
-1 676a0fbbf09948bcbb18e5f61d27f51b Tue 2018-06-05 11:28:20 JST—Tue 2018-06-05 13:55:23 JST
0 92feec044ea94d88a6f95548df223f80 Wed 2018-06-06 00:51:40 JST—Wed 2018-06-06 00:57:37 JST
ããã¾ã§ logging ãã boot ID ã®ä¸è¦§ãåºãã¦ããã¾ã。ããã§,「ã,ä¸æ¨æ¥èµ·åããã¨ãã®ãã°ãè¦ãããªã¼。ä¸æ¨æ¥èµ·åããã®ã¯äºååã®èµ·åã®ã¨ããã¼」ã£ã¦ãªã£ãã,
$ journalctl -b -2
ã¨ããã°ããããã§ã。ã¡ãªã¿ã«,åã«ä»èµ·åãã¦ããåã®ãã°ã ãè¦ããå ´åã¯,
$ journalctl -b
0
ã¨ãããããæå®ããªãã¦å¤§ä¸å¤«。
dmesg
æ°ãããã·ã³ãè²·ã£ããã¨ããããdmesg
ãã¦ã©ããã«è²¼ãä»ããã¨ãã¿ãªããããããã¨æãã¾ã。
ã,ãã£ãã dmesg åãå¿ãã¦è²ã
ãã£ã¦ãã¨ã«ã¼ãã«ãã°ã«æµããã¦èµ·åæã®æ¬²ããã¡ãã»ã¼ã¸ã¯ã©ã£ãæµãã¦ãã£ã¡ããã¨æãã¾ã。ããã§,
$ journalctl -k -b -o short-monotonic
ã便å©ã§ã。ã¡ãªã¿ã«ãªãã·ã§ã³ã®æå³ã¯,-k
ã§ã«ã¼ãã«ã®ãã°ã ã表示,ããã»ã©ã«ãåºã -b
ã¯é£ã°ãã¦æ¬¡ã® -o short-monotonic
ã¯ãã°ã®ã¿ã¤ã ã¹ã¿ã³ãã®å½¢å¼ã dmesg
åæ§ã®ã¢ããããã¯æå»ã«ãããã¤ã§ã。æå¾ã®ãªãã·ã§ã³ãæå®ããªãã¨ããã©ã«ãã 㨠wall clock time ã«ãªã£ã¦ãã¾ãã®ã§,ä½æä½åã®ã¤ãã³ãã ã£ãããªã©ã¯äººéã«åªããåºåã§ããããããã§ãã,dmesg ã®ããã«èµ·åãã¦ããä½ç§ããç¥ãããå ´åã¯ããã使ãã¾ã。ã¡ãªã¿ã«ã§ãã,
-o
ã«ã¯ json
ãæå®ããã¨ãã°ã json ã§åºã¦ããã,short-unix
ã 㨠UNIX æéã§åºåãããã,è²ã
ã¨ä¾¿å©ã§é¢ç½ãæ©è½ãå¤ãã®ã§ãããããã。
ãã¾ã
journald ã¯é¢ä¿ãªãã§ãã,systemd 㨠logging ã¨ãããã¨ã§ã¤ãã§ã«ããã²ã¨ã¤。$ systemd-analyze
ã¯ãã¡ã¼ã ã¦ã§ã¢,ã«ã¼ãã«,ã¦ã¼ã¶ã¼ç©ºéã§èµ·åã«ã©ãã ãæéãããã£ããè¦ãã¦ä¾¿å©ãªä¸ã«,ãªãã·ã§ã³ã¨ã㦠plot
ãæå®ãã¦å³ã«ããã critical-chain
ãæå®ãã¦èµ·åæã®ã¯ãªãã£ã«ã«・ãã§ã¼ã³ãæ´ãåºããªã©ãåºæ¥ã¾ã。