On Thu, 1 Aug 2013, Zippy Zeppoli wrote:

Hello,
I am having a problem where I am reading from a file, and it is a JBoss
application server log, so it logs large stacktraces with many newlines,
but each line is being interpreted as a log message.

Any ideas on how to fix it?

There are two ways to address this.

Using imfile you can change the readmode

by default it reads each line as an independant log entry

but you can change it so that it holds off on delivering one log message until it sees the beginning of the next log message (allowing it to combine multiple lines into one log message), the definition of a new log message can be a line that doesn't begin with whitespace (which is probably what you need for Java stack traces) or a blank line between entries (two newlines back to back)

http://www.rsyslog.com/doc/imfile.html

The other approach is to change how your java code is delivering the log. Instead of just writing it to disk and having another process scrape the file (and try to interpret the file), you can have your Java code log directly to syslog, at which point there is no ambguity about what each message is.

David Lang

_______________________________________________
rsyslog mailing list
http://lists.adiscon.net/mailman/listinfo/rsyslog
http://www.rsyslog.com/professional-services/
What's up with rsyslog? Follow https://twitter.com/rgerhards
NOTE WELL: This is a PUBLIC mailing list, posts are ARCHIVED by a myriad of 
sites beyond our control. PLEASE UNSUBSCRIBE and DO NOT POST if you DON'T LIKE 
THAT.

Reply via email to