SyslogAppender retains stack trace when it shouldn't

78 views
Skip to first unread message

kumar k

unread,
May 1, 2020, 9:26:31 PM5/1/20
to dropwizard-dev

Hello,


I am attempting to configure the drop wizard application to send logs to 

syslog for centralized logging. I've located the correct logger, and I've successfully 

configured a SyslogAppender to send the events to syslog, but I'm 

getting an odd bit of  a stack trace in the syslog, even though I think 

It shouldn't.


When the line gets logged to syslog, I see the first line correctly, but 

that line is followed by a stack trace, except that the beginning of the 

stack trace is replaced with the string "#011". What I want is no stack 

trace at all, which I ought to be able to get with %nopex, except that 

doesn't seem to work.Can you please help me on this issue?



Drop Wizard version:0.9.2

Log Back version: 1.1.2


drop wizard logging config:


syslog:

    enabled: 'true'

    threshold: ALL

    host: localhost

    facility: local6

    logFormat: "MMJ: %p [%logger{0} %t] %c{30} [%X] %m %nopex"




Log snippet from syslog:

2020-04-27T13:20:46+00:00 MMJ MMJ: ERROR [ConcurrentAuditPersisterQueueSubscriber qe_Event_Queue_AUDIT-1] t.h.w.a.s.ConcurrentAuditPersisterQueueS ubscriber Error processing message payload  [] 

2020-04-27T13:20:46+00:00 MMJ #011net.liftweb.json.JsonParser$ unknown token <#012Near:

2020-04-27T13:20:46+00:00 MMJ #011at scala.Option.orElse(Option.scala:289)

2020-04-27T13:20:46+00:00 MMJ #011at scala.collection.immutab




Thanks,

Kumar

kumar k

unread,
May 1, 2020, 10:57:44 PM5/1/20
to dropwiz...@googlegroups.com
I found on other blogs that by making this property throwableExcluded to true.
I noticed folks are using logback.xml and adding this parameter to true which fixes the issue.
But in our case,we are using a yaml file for all the drop wizard config and not sure how to add this property(throwableExcluded) to true.
Is this value needed to to changed to true in the class file (ch/qos/logback/classic/net/SyslogAppender.class)?
Can you please help?


public SyslogAppender() {
        this.stackTraceLayout = new PatternLayout();
        this.stackTracePattern = "\t";
        this.throwableExcluded = false;

--
You received this message because you are subscribed to the Google Groups "dropwizard-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dropwizard-de...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dropwizard-dev/c3e31415-8c72-43c0-adf1-7468899c27c6%40googlegroups.com.

Jochen Schalanda

unread,
Jun 11, 2020, 5:38:01 AM6/11/20
to dropwiz...@googlegroups.com
Hi Kumar,

you can use the "includeStackTrace" configuration setting for the syslog appender to disable sending stack traces to the syslog service.

Unfortunately this setting wasn't properly documented before which will be fixed in https://github.com/dropwizard/dropwizard/pull/3329.

Cheers,
Jochen

kumar k

unread,
Jun 11, 2020, 10:46:53 AM6/11/20
to dropwiz...@googlegroups.com
Thanks Jochen.


--
You received this message because you are subscribed to the Google Groups "dropwizard-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dropwizard-de...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages