小编典典
我需要重新编译内核吗?
没有。
还是有一种方法可以使更改的值在重新引导后保持不变。
是。
使用内核命令行参数loglevel:
loglevel= All Kernel Messages with a loglevel smaller than the
console loglevel will be printed to the console. It can
also be changed with klogd or other programs. The
loglevels are defined as follows:
0 (KERN_EMERG) system is unusable
1 (KERN_ALERT) action must be taken immediately
2 (KERN_CRIT) critical conditions
3 (KERN_ERR) error conditions
4 (KERN_WARNING) warning conditions
5 (KERN_NOTICE) normal but significant condition
6 (KERN_INFO) informational
7 (KERN_DEBUG) debug-level messages
根据您的引导程序(例如Grub或U-Boot),您将必须编辑文本以将此新参数添加到命令行。使用cat
/proc/cmdline查看使用以前的引导内核的命令行。
附录
为了显示所有内容,为loglevel参数提供的数字应大于KERN_DEBUG。
也就是说,您必须指定loglevel=8。
或者直接使用该ignore_loglevel参数显示所有内核消息。
2020-06-03
本文介绍如何通过修改内核命令行参数loglevel来持久化地调整系统日志级别,确保特定级别的日志信息能在重启后依然保留。此外,还介绍了如何通过其他工具如klogd进一步定制日志行为。
45

被折叠的 条评论
为什么被折叠?



