Reactor-netty: How to log access logs to file any configuration?

Created on 28 Feb 2018  路  11Comments  路  Source: reactor/reactor-netty

typenhancement

Most helpful comment

Fixed with e26831e
Only CLF is supported for the moment.
-Dreactor.netty.http.server.accessLogEnabled=true can be used to enable access log (by default it is disabled)
The configuration below (logback) or similar (other logging frameworks) can be used to have a separate access log file

    <appender name="accessLog" class="ch.qos.logback.core.FileAppender">
        <file>access_log.log</file>
        <encoder>
            <pattern>%msg%n</pattern>
        </encoder>
    </appender>
    <appender name="async" class="ch.qos.logback.classic.AsyncAppender">
        <appender-ref ref="accessLog" />
    </appender>

    <logger name="reactor.netty.http.server.AccessLog" level="INFO" additivity="false">
        <appender-ref ref="async"/>
    </logger>

All 11 comments

Hi,

There is no access log available at the moment.
Mark this as enhancement.

Regards,
Violeta

Users of spring-cloud-gateway are asking for this.

What about this feature ?

+1

+1

+1

+1

+1

+1

+1

Fixed with e26831e
Only CLF is supported for the moment.
-Dreactor.netty.http.server.accessLogEnabled=true can be used to enable access log (by default it is disabled)
The configuration below (logback) or similar (other logging frameworks) can be used to have a separate access log file

    <appender name="accessLog" class="ch.qos.logback.core.FileAppender">
        <file>access_log.log</file>
        <encoder>
            <pattern>%msg%n</pattern>
        </encoder>
    </appender>
    <appender name="async" class="ch.qos.logback.classic.AsyncAppender">
        <appender-ref ref="accessLog" />
    </appender>

    <logger name="reactor.netty.http.server.AccessLog" level="INFO" additivity="false">
        <appender-ref ref="async"/>
    </logger>
Was this page helpful?
0 / 5 - 0 ratings