[logback-user] Can AsyncAppenders be used with logback access?

Roberto Ferreras rober at rober.cc
Wed May 1 19:40:46 CEST 2013


After setting up AsyncAppenders for the application log, I tried to use 
them on the request log (I am using Jetty) and I get this exception:

13:19:56,792 |-ERROR in 
ch.qos.logback.classic.AsyncAppender[async-request] - Appender 
[async-request] failed to append. java.lang.ClassCastException: 
ch.qos.logback.access.spi.AccessEvent cannot be cast to 
ch.qos.logback.classic.spi.ILoggingEvent
     at java.lang.ClassCastException: 
ch.qos.logback.access.spi.AccessEvent cannot be cast to 
ch.qos.logback.classic.spi.ILoggingEvent
     at     at 
ch.qos.logback.classic.AsyncAppender.preprocess(AsyncAppender.java:28)
     at     at 
ch.qos.logback.core.AsyncAppenderBase.append(AsyncAppenderBase.java:129)
     at     at 
ch.qos.logback.core.UnsynchronizedAppenderBase.doAppend(UnsynchronizedAppenderBase.java:88)
     at     at 
ch.qos.logback.core.spi.AppenderAttachableImpl.appendLoopOnAppenders(AppenderAttachableImpl.java:48)
     at     at 
ch.qos.logback.access.jetty.RequestLogImpl.log(RequestLogImpl.java:142)

Later I have found at the docs "AsyncAppender logs ILoggingEvents 
asynchronously", so it seems that they can't be used with logback 
access, is that correct?

Thanks.



More information about the Logback-user mailing list