Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Skip messages in dmesg using syslog-ng
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
trumee
Guru
Guru


Joined: 02 Mar 2003
Posts: 551
Location: London,UK

PostPosted: Sat Jun 07, 2014 12:14 am    Post subject: Skip messages in dmesg using syslog-ng Reply with quote

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
View user's profile Send private message
krinn
Watchman
Watchman


Joined: 02 May 2003
Posts: 7470

PostPosted: Sat Jun 07, 2014 12:51 am    Post subject: Re: Skip messages in dmesg using syslog-ng Reply with quote

Code:

log {
source(src);
filter(f_ivtv);
destination(df_ivtv);
flags(final)
};

Back to top
View user's profile Send private message
khayyam
Watchman
Watchman


Joined: 07 Jun 2012
Posts: 6227
Location: Room 101

PostPosted: Sat Jun 07, 2014 1:23 am    Post subject: Re: Skip messages in dmesg using syslog-ng Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum