Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

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

Your Answer


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.