Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

About to print KERNEL messages on terminal

According to manual page it told that if priority of message's log level is higher than default set log level then it will be printed on terminal. But when I had used sentence like

printk(KERN_ALERT " MESSAGE ")

I am facing problem to print message on terminal. Because the default priority is set to 4 and KERN_ALERT has priority 1, which is higher.

So, how can I print message on terminal?

like image 972
Vikrant Avatar asked Mar 25 '23 05:03

Vikrant


1 Answers

It should print messages to the console, not to the terminal. Sometimes the console and the terminal seems the same, but it is not. Edit /proc/sys/kernel/printk to set up the lowest priority to print in console

like image 192
Federico Avatar answered Apr 01 '23 19:04

Federico