[syslog-ng] proper filtering messages with java Exceptions

Franciszek Zmarły galaxy20 at wp.pl
Tue Jun 22 12:15:25 CEST 2010


Hello

I have a problem with filtering messages having java Exceptions. I send 
logs from many jvm processes to one syslog-ng server and save them to 
different files.

Example one message from log4j (dump from wireshark)
<139>Jun 18 10:53:03 td2/td2 [PROGRAM NAME - MainThread] ERROR - FATAL 
ERROR
<139>Jun 18 10:53:03 td2/td2 java.lang.Exception: Invalid value 
TryCount: 0
<139>Jun 18 10:53:03 td2/td2 at com.td.Sender.initialize(Sender.java:30)
<139>Jun 18 10:53:03 td2/td2 td2 at com.td.Main.main(Main.java:123)

I use changed thread name (PROGRAM NAME) as filter in syslog-ng 
configuration
filter f_td_p1 { match("PROGRAM NAME"); };

but in this configuration ony first line of message are saved (from log 
file)
2010-06-18 10:53:03 td2 [PROGRAM NAME-MainThread] ERROR - FATAL ERROR

Is it possible to correct save all logs ? Of course all messages in 
examle is one log message. Log4j save it like this:
2010-06-18 10:53:03,242 [PROGRAM NAME-MainThread-MainThread] ERROR - 
FATAL ERROR
java.lang.Exception: Invalid value TryCount: 0
        at com.td.Sender.initialize(Sender.java:30)
        at com.td.Main.main(Main.java:123)

I want to obtain same effect in syslog-ng.
Have you any suggestion ? Please help.

Regards
Frank




More information about the syslog-ng mailing list