View previous topic :: View next topic |
Author |
Message |
trumee Guru
Joined: 02 Mar 2003 Posts: 551 Location: London,UK
|
Posted: Sat Jun 07, 2014 12:14 am Post subject: Skip messages in dmesg using syslog-ng |
|
|
Hi,
I have couple of ivtv cards which tend to fill up my dmesg with lot of error messages. I have written rules in /etc/syslog-ng to capture these in /var/log/ivtv.log which works. However the messages still appear in dmesg.
Any idea why my syslog-ng doesnt skip messages in dmesg?
Code: |
#cat /etc/syslog-ng.conf
@version: 3.4
# $Header: /var/cvsroot/gentoo-x86/app-admin/syslog-ng/files/3.4/syslog-ng.conf.gentoo,v 1.2 2013/06/02 01:18:35 mr_bones_ Exp $
#
# Syslog-ng default configuration file for Gentoo Linux
# https://bugs.gentoo.org/show_bug.cgi?id=426814
@include "scl.conf"
options {
threaded(yes);
chain_hostnames(no);
stats_freq(43200);
mark_freq(3600);
};
source src { system(); internal(); };
source syslog_udp {
udp(port(514));
};
destination messages { file("/var/log/messages"); };
destination df_wrt0 {
file("/var/log/router.log"
owner("xx") group("users"));
};
# By default messages are logged to tty12...
destination console_all { file("/dev/tty12"); };
log {
source(syslog_udp);
destination(df_wrt0);
};
destination mythbackend { file("/var/log/mythtv/mythbackend.log"); };
destination mythfrontend { file("/var/log/mythtv/mythfrontend.log"); };
destination mythfilldatabase { file("/var/log/mythtv/mythfilldatabase.log"); };
destination mythcommflag { file("/var/log/mythtv/mythcommflag.log"); };
destination mythpreviewgen { file("/var/log/mythtv/mythpreviewgen.log"); };
destination mythmetadatalookup { file("/var/log/mythtv/mythmetadatalookup.log"); };
destination mythlogserver { file("/var/log/mythtv/mythlogserver.log"); };
filter f_mythbackend { facility("local7") and match("mythbackend" value("MESSAGE")); };
filter f_mythfrontend { facility("local7") and match("mythfrontend" value("MESSAGE")); };
filter f_mythcommflag { facility("local7") and match("mythcommflag" value("MESSAGE")); };
filter f_mythpreviewgen { facility("local7") and match("mythpreviewgen" value("MESSAGE")); };
filter f_mythmetadatalookup { facility("local7") and match("mythmetadatalookup" value("MESSAGE")); };
filter f_mythfilldatabase { facility("local7") and match("mythfilldatabase" value("MESSAGE")); };
filter f_mythlogserver { facility("local7") and match("mythlogserver" value("MESSAGE")); };
log { source(src); filter(f_mythbackend); destination(mythbackend); };
log { source(src); filter(f_mythfrontend); destination(mythfrontend); };
log { source(src); filter(f_mythfilldatabase); destination(mythfilldatabase); };
log { source(src); filter(f_mythcommflag); destination(mythcommflag); };
log { source(src); filter(f_mythpreviewgen); destination(mythpreviewgen); };
log { source(src); filter(f_mythmetadatalookup); destination(mythmetadatalookup); };
log { source(src); filter(f_mythlogserver); destination(mythlogserver); };
destination df_ivtv {file("/var/log/ivtv.log"); };
filter f_ivtv {match("ivtv0" value("MESSAGE")); };
log {
source(src);
filter(f_ivtv);
destination(df_ivtv);
};
destination df_null {file("/var/log/zm.log"); };
filter f_libjpeg {match("INF" value("MESSAGE")); };
log {
source(src);
filter(f_libjpeg);
destination(df_null);
flags(final);
};
log { source(src); destination(messages); };
log { source(src); destination(console_all); };
|
Sample messages popping up in dmesg
Code: |
dmesg |tail
[111742.858250] ivtv0: All encoder PCM stream buffers are full. Dropping data.
[111742.858253] ivtv0: Cause: the application is not reading fast enough.
[112375.528420] ivtv0: All encoder PCM stream buffers are full. Dropping data.
[112375.528423] ivtv0: Cause: the application is not reading fast enough.
[113332.199475] ivtv0: All encoder PCM stream buffers are full. Dropping data.
[113332.199478] ivtv0: Cause: the application is not reading fast enough.
[113568.698017] ivtv0: All encoder PCM stream buffers are full. Dropping data.
[113568.698026] ivtv0: Cause: the application is not reading fast enough.
[114308.856620] ivtv0: All encoder PCM stream buffers are full. Dropping data.
[114308.856627] ivtv0: Cause: the application is not reading fast enough.
|
|
|
Back to top |
|
|
krinn Watchman
Joined: 02 May 2003 Posts: 7470
|
Posted: Sat Jun 07, 2014 12:51 am Post subject: Re: Skip messages in dmesg using syslog-ng |
|
|
Code: |
log {
source(src);
filter(f_ivtv);
destination(df_ivtv);
flags(final)
};
|
|
|
Back to top |
|
|
khayyam Watchman
Joined: 07 Jun 2012 Posts: 6227 Location: Room 101
|
Posted: Sat Jun 07, 2014 1:23 am Post subject: Re: Skip messages in dmesg using syslog-ng |
|
|
trumee wrote: | I have couple of ivtv cards which tend to fill up my dmesg with lot of error messages. I have written rules in /etc/syslog-ng to capture these in /var/log/ivtv.log which works. However the messages still appear in dmesg. |
trumee ... dmesg reads the kernel ring buffer, this is also what syslog-ng reads and filters. syslog-ng doesn't have any means of effecting what the kernel produces, only what gets logged and where.
You can effect the logging by 'not'ing the facility, eg:
Code: | filter f_messages { level(info..warn) and not facility(auth, authpriv, mail); };
log { source(src); filter(f_messages); destination(messages); }; |
... but I don't think this is what you're looking for, if its just a matter of filtering what dmesg returns you can provide a (comma seperated) list of facilities to list with '--facility='.
HTH & best ... khay |
|
Back to top |
|
|
|