Re: How can we redirect kernel console message to a file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi ,
Thanks.
From  the man page of dmesg
"dmesg  -n 1"  prevents all  messages,  expect  panic  messages,  from  appearing  on the console.
This is what I wanted.

Regards,
Neeps

Vijay Subramanian wrote:
kern.*                                                 /var/log/kernel-log
it's putting the messages also ,as well as giving output to console
,that is what
I do not want.
    

If you do not want messages on the console, you can decrease the
console_loglevel.
One way is to write to the file /proc/sys/kernel/printk
example: echo 3 >  /proc/sys/kernel/printk

The second integer in the file contains the default message level
which can be raised
so that it does not show up on the console.

If you keep writing to the buffer without reading , it will overflow
eventually (LOG_BUF_LEN in printk.c) 16Kb for x86 I think.
You can use klogd with the -f option to write to a file. You can also
keep reading /proc/kmsg and redirect to a file.

Hope this helps.
vijay

  


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux