如何在CentOS 7 Linux中检查上一次引导的系统日志日志?

The command to check last boot’s journal log shows nothing on CentOS 7:

检查上一次启动的日志日志的命令在CentOS 7上未显示任何内容:

# journalctl -b -1

Failed to look up boot -1: No such boot ID in journal

Is the log stored and where it is?

日志是否存储在哪里?

The reason this happens on CentOS 7 is that CentOS 7 by default does not enable the persistent storage of log messages. You can enable it and configure journald to store the log files into `/var/log/journal` by

在CentOS 7上发生这种情况的原因是,默认情况下CentOS 7不启用日志消息的持久存储 。 您可以启用它并配置日记日志,以通过以下方式将日志文件存储到`/ var / log / journal`中:

# mkdir /var/log/journal
# systemd-tmpfiles --create --prefix /var/log/journal
# systemctl restart systemd-journald

翻译自: https://www.systutorials.com/how-to-check-last-boots-systemd-journal-log-in-centos-7-linux/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值