Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

We are using the log4j SyslogAppender to send our logging statements to syslog-ng. Once the messages are in syslog-ng, we are having trouble getting syslog-ng to recognize that a stacktrace goes with the appropriate logging statement. Thus, when we filter the messages (which we do to separate out ERROR level statements for monitoring alarms) the stacktrace gets lost. Does anyone know if it is possible to do this? We are using the open source version of syslog-ng version 3.1.4 on Gentoo.

share|improve this question
add comment

2 Answers

I'm not familiar with Syslog-ng specifically, but I do know that in regular syslog, and in rsyslog, a new line indicates a new message. I think you'd have to strip all the new line characters out of the stack trace for this to work, which would obviously make the stack traces quite difficult to read.

share|improve this answer
    
we were trying to avoid this for the reason you stated of it making the stacktraces difficult to read. –  Matt Campbell Aug 10 '12 at 14:36
add comment

I ended up writing a custom Syslog Appender that puts the proper prefix on each line of the stacktrace so that the stack trace lines can get sorted properly by our syslog filters. It isn't perfect, but it is working well enough.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.