栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 面试经验 > 面试问答

在启动过程中更改默认控制台日志级别

面试问答 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

在启动过程中更改默认控制台日志级别

我需要重新编译内核吗?

没有。

还是有一种方法可以使更改的值在重新引导后保持不变。

是。
使用内核命令行参数

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

内核命令行上所有可能的参数列表都在

Linux/documentation/kernel-parameters.txt
源代码树的文件中。

根据您的引导程序(例如Grub或U-Boot),您将必须编辑文本以将此新参数添加到命令行。使用

cat/proc/cmdline
查看使用以前的引导内核的命令行。


附录

为了显示所有内容,为loglevel参数提供的数字应大于KERN_DEBUG。
也就是说,您必须指定

loglevel=8

或者直接使用该
ignore_loglevel
参数显示所有内核消息。



转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/381201.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号