Kernel log mechanism: How to log messages in a different file

Ramesh.P rameshpa at gmail.com
Mon Jun 27 12:57:12 EDT 2011


Hi,

Regarding dmesg. I believe it will still show up in it. It can be
controlled by /proc/sys/kernel/printk settings. As per man 5 proc:

       /proc/sys/kernel/printk
              The four values in this file are console_loglevel,  default_mes-
              sage_loglevel,     minimum_console_level     and    default_con-
              sole_loglevel.  These values influence  printk()  behavior  when
              printing  or logging error messages.

Regards,
Ramesh

On Sat, Jun 25, 2011 at 1:05 PM, Mulyadi Santosa
<mulyadi.santosa at gmail.com> wrote:
> On Sat, Jun 25, 2011 at 20:40, amit mehta <gmate.amit at gmail.com> wrote:
>> Hi,
>>
>> I've written some kernel modules using kprobes infrastructure
>> to grab some more information on network packets. I've lots of
>> printk which by default show up in syslog file(/var/log/messages),
>> I was wondering if there are some method to redirect my printkS
>> to appear in somewhere else(say /var/log/netlog).
>> On a busy system, it gets little cluttered with other logs. Of-course
>> i can grep for my own custom messages but it would be lot more
>> convenient if i can redirect my messages in  a separate log file.
>
> side speaking, consider using netlink and create a user space netlink
> grabber specificly to read the messages that thrown in your netlink
> channel. IMO that would be faster and not cluttering the syslog
> buffer...especially if you need to save tons of messages.....just my $
> 0.002 tips :D
>
> --
> regards,
>
> Mulyadi Santosa
> Freelance Linux trainer and consultant
>
> blog: the-hydra.blogspot.com
> training: mulyaditraining.blogspot.com
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>



More information about the Kernelnewbies mailing list