kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
* Kernel log mechanism: How to log messages in a different file
@ 2011-06-25 13:40 amit mehta
  2011-06-25 13:49 ` Bruce Rowen
  2011-06-25 20:05 ` Mulyadi Santosa
  0 siblings, 2 replies; 6+ messages in thread
From: amit mehta @ 2011-06-25 13:40 UTC (permalink / raw)
  To: kernelnewbies

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.

Considering above can be done, then what about dmesg ?
will they still show up in dmesg output ?

Regards,
Amit

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Kernel log mechanism: How to log messages in a different file
  2011-06-25 13:40 Kernel log mechanism: How to log messages in a different file amit mehta
@ 2011-06-25 13:49 ` Bruce Rowen
  2011-06-25 15:06   ` amit mehta
  2011-06-25 20:05 ` Mulyadi Santosa
  1 sibling, 1 reply; 6+ messages in thread
From: Bruce Rowen @ 2011-06-25 13:49 UTC (permalink / raw)
  To: kernelnewbies

syslog.conf

On Jun 25, 2011, at 7:40 AM, amit mehta 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.
>
> Considering above can be done, then what about dmesg ?
> will they still show up in dmesg output ?
>
> Regards,
> Amit
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Kernel log mechanism: How to log messages in a different file
  2011-06-25 13:49 ` Bruce Rowen
@ 2011-06-25 15:06   ` amit mehta
  0 siblings, 0 replies; 6+ messages in thread
From: amit mehta @ 2011-06-25 15:06 UTC (permalink / raw)
  To: kernelnewbies

Thanks Bruce, On my system,

[rango at localhost:] locate syslog.conf
/etc/rsyslog.conf
/etc/init/rsyslog.conf
/usr/share/man/man5/rsyslog.conf.5.gz
/var/lib/dpkg/info/rsyslog.conffiles

Also there is a configuration file under
/etc/rsyslog.d/50-default.conf which has
the rules for logging messages in various files, I guess I need to
edit this file.
As of now I'm also looking into the information available here:
http://wiki.rsyslog.com/index.php/Configuration_Samples

Regards,
Amit

On Sat, Jun 25, 2011 at 7:19 PM, Bruce Rowen <browen@aoc.nrao.edu> wrote:
> syslog.conf
>
> On Jun 25, 2011, at 7:40 AM, amit mehta 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.
>>
>> Considering above can be done, then what about dmesg ?
>> will they still show up in dmesg output ?
>>
>> Regards,
>> Amit
>>
>> _______________________________________________
>> Kernelnewbies mailing list
>> Kernelnewbies at kernelnewbies.org
>> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Kernel log mechanism: How to log messages in a different file
  2011-06-25 13:40 Kernel log mechanism: How to log messages in a different file amit mehta
  2011-06-25 13:49 ` Bruce Rowen
@ 2011-06-25 20:05 ` Mulyadi Santosa
  2011-06-27 16:57   ` Ramesh.P
  1 sibling, 1 reply; 6+ messages in thread
From: Mulyadi Santosa @ 2011-06-25 20:05 UTC (permalink / raw)
  To: kernelnewbies

On Sat, Jun 25, 2011 at 20:40, amit mehta <gmate.amit@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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Kernel log mechanism: How to log messages in a different file
  2011-06-25 20:05 ` Mulyadi Santosa
@ 2011-06-27 16:57   ` Ramesh.P
  2011-06-30  5:12     ` अनुज
  0 siblings, 1 reply; 6+ messages in thread
From: Ramesh.P @ 2011-06-27 16:57 UTC (permalink / raw)
  To: kernelnewbies

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@gmail.com> wrote:
> On Sat, Jun 25, 2011 at 20:40, amit mehta <gmate.amit@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
>

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Kernel log mechanism: How to log messages in a different file
  2011-06-27 16:57   ` Ramesh.P
@ 2011-06-30  5:12     ` अनुज
  0 siblings, 0 replies; 6+ messages in thread
From: अनुज @ 2011-06-30  5:12 UTC (permalink / raw)
  To: kernelnewbies

On Mon, Jun 27, 2011 at 10:27 PM, Ramesh.P <rameshpa@gmail.com> wrote:
> 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@gmail.com> wrote:
>> On Sat, Jun 25, 2011 at 20:40, amit mehta <gmate.amit@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
>>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>

Try syslog-ng:

http://en.wikipedia.org/wiki/Syslog-ng

http://itexam.blogspot.com/2009/03/logging-with-syslog-ng.html

google for more !


-- 
Anuj Aggarwal

?.''`.
: :? :?? # apt-get install hakuna-matata
`. `'`
?? `-

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2011-06-30  5:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-25 13:40 Kernel log mechanism: How to log messages in a different file amit mehta
2011-06-25 13:49 ` Bruce Rowen
2011-06-25 15:06   ` amit mehta
2011-06-25 20:05 ` Mulyadi Santosa
2011-06-27 16:57   ` Ramesh.P
2011-06-30  5:12     ` अनुज

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).