Introduce AsyncAppender for logback-access: LOGBACK-827
Introduced ch.qos.logback.access.AsyncAppender which accepts IAccessEvents.
Standard AsyncAppender from logback-classic does not support IAccessEvents and fails with exception:
18:31:29,255 |-ERROR in ch.qos.logback.classic.AsyncAppender[access.file.async] - Appender [access.file.async] 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)
Proposed fix for http://jira.qos.ch/browse/LOGBACK-827
Example logback-access.xml:
<?xml version='1.0' encoding='utf-8'?>
<configuration>
<!-- always a good activate OnConsoleStatusListener -->
<statusListener class="ch.qos.logback.core.status.OnConsoleStatusListener"/>
<!-- See for reference: http://logback.qos.ch/access.html#configuration -->
<appender name="access.file" class="ch.qos.logback.core.rolling.RollingFileAppender">
<file>${catalina.base}/logs/access.log</file>
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
<!-- rollover daily -->
<fileNamePattern>${catalina.base}/logs/access.%d{yyyy-MM-dd}.%i.log.tar.gz</fileNamePattern>
<timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
<!-- or whenever the file size reaches 100MB -->
<maxFileSize>100KB</maxFileSize>
</timeBasedFileNamingAndTriggeringPolicy>
</rollingPolicy>
<encoder>
<pattern>combined</pattern>
</encoder>
</appender>
<appender name="access.file.async" class="ch.qos.logback.access.AsyncAppender">
<appender-ref ref="access.file"/>
</appender>
<appender-ref ref="access.file.async"/>
</configuration>
commit cb5d423 changes a bunch of lines in DummyRequest.java making it hard to see what actually changed. Please use the same formatting as the rest of the code, in particular indent size of 2. As such, I can't merge this pull request for the moment.
Please also read and follow the steps outlines in the contribution guidelines
Hi,
When can we expect this feature? Will this be merged?
Hey people any news about this feature :)
Hi there, we are seeing this issue now, any updates on the fix?
Yo. Would love to use AsyncAppender for my access events. Any news?