Open madmuffin1 opened 8 years ago
Hi,
I can confirm that there is a NPE in that case. Note that it's not because callerData
is null
, but rather due to loggerContext
being null
. I'm unsure yet whose fault that is.
Note that dropwizard-gelf comes with its own request logger (GelfLoggingFilter
). To use it, add the following lines to your App#run()
method:
environment.servlets()
.addFilter("request-logs", new GelfLoggingFilter())
.addMappingForUrlPatterns(EnumSet.allOf(DispatcherType.class), true, "/*");
Debugging trying to figure out why my http requests aren't showing up in my logging server I found that the ch.qos.logback.core.AppenderBase is throwing a ClassCastException.
java.lang.ClassCastException: ch.qos.logback.access.spi.AccessEvent cannot be cast to ch.qos.logback.classic.spi.ILoggingEvent
at biz.paluch.logging.gelf.logback.GelfLogbackAppender.append(GelfLogbackAppender.java:71)
at ch.qos.logback.core.AppenderBase.doAppend(AppenderBase.java:82)
at ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48)
at ch.qos.logback.core.AsyncAppenderBase$Worker.run(AsyncAppenderBase.java:265)
So it appears that thad the RequestLog is sending an AccessEvent but the underlying logging structure can't handle that.
@kevinmic Which version of Dropwizard are you using?
io.dropwizard:dropwizard-core:jar:1.0.0
I'm seeing the same issue. Dropwizard v1.1.2.
Hi,
I am trying to also send the requestLog to our graylog server. Unfortunately, it does not work (messages are dropped silently). The instance is created correctly but messages cause a NPE in LogbackLogEvent.getCalleeStackTraceElement:74 since the callerDataArray in LogbackLogEvent.loggingEvent.getCallerData() is null.
My entries in the config section:
Versions: Dropwizard 0.9.2, Dropwizard-GELF 0.9.2-4