[logback-user] Logback question

Russ Lavoie russlavoie at gmail.com
Wed Nov 19 22:03:57 CET 2014


Hello,

I am having issues using the Asyncappender for logback with the following
configuration.

<snip>
<?xml version="1.0" encoding="UTF-8"?>
<configuration>

  <!-- Access Logging -->
  <appender name="accessLog"
class="ch.qos.logback.core.rolling.RollingFileAppender">
    <file>/mnt/log/jetty/jetty_access.log</file>
    <rollingPolicy
class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <param name="FileNamePattern"
value="/mnt/log/jetty/jetty_access.log.%d{yy-MM-dd}.gz" />
      <maxHistory>7</maxHistory>
      <maxFileSize>1M</maxFileSize>
    </rollingPolicy>
    <layout class="ch.qos.logback.access.PatternLayout">
      <param name="Pattern" value='{
        "@timetamp":  "%date",
        "clientip": "%i{x-forwarded-for}",
        "urlpath": "%requestURI",
        "status": %statusCode,
        "method": "%requestMethod",
        "referer": "%header{Referer}",
        "bytes": %bytesSent,
        "duration": %elapsedTime,
        "xtid": "%header{X-TID}"}' />
    </layout>
  </appender>

  <appender name="asyncaccessLog"
class="ch.qos.logback.classic.AsyncAppender">
    <queueSize>500</queueSize>
    <discardingThreshold>80</discardingThreshold>
    <appender-ref ref="accessLog" />
  </appender>

  <root level="trace">
    <appender-ref ref="asyncaccessLog" />
  </root>

</configuration>
</snip>

It does not write the access data to file.

However, if I remove the asyncaccessLog appender and the root block.  Then
only add the <appender-ref ref="accessLog" /> by it self after </appender>
it works with no issue.  It will not work if I am trying to send the
accessLog appender through the asyncaccessLog appender.

Can I get any help here?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20141119/4aefae70/attachment.html>


More information about the Logback-user mailing list