如何永久更改linux printk日志级别?

时间:2023-01-24 23:06:58

I have to run the following command every time when the system is rebooted, in order to get boot time log level changed to level 3:

每次重新启动系统时,我都必须运行以下命令,以便将启动时间日志级别更改为级别3:

cat /proc/sys/kernel/printk
7 4 1 7
echo "7 4 1 3">/proc/sys/kernel/printk

My question is: is there any way I can get the boot time log level set to 3 permanently instead of changing it every time after reboot?

我的问题是:有没有什么方法可以将启动时间日志级别永久设置为3而不是每次重启后都更改它?

1 个解决方案

#1


1  

Just append following line to /etc/sysctl.conf file:

只需将以下行附加到/etc/sysctl.conf文件:

kernel.printk = 7 4 1 3

kernel.printk = 7 4 1 3

#1


1  

Just append following line to /etc/sysctl.conf file:

只需将以下行附加到/etc/sysctl.conf文件:

kernel.printk = 7 4 1 3

kernel.printk = 7 4 1 3