<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">

    <Properties>
        <Property name="dfltPattern">%d{yyyy-dd-MM HH:mm:ss.SSS} | %-5level | %20.20c{1} | %msg%n</Property>
        <!--        <Property name="dfltPattern">%d{HH:mm:ss.SSS} [%-20.20t] %-5level %24.24c{1} | %msg%n</Property>-->
    </Properties>

    <Appenders>
        <Console name="STDOUT" target="SYSTEM_OUT">
            <PatternLayout pattern="${dfltPattern}"/>
            <Filters>
                <ThresholdFilter level="WARN"   onMatch="DENY" onMismatch="ACCEPT" />
            </Filters>
        </Console>
        <Console name="STDERR" target="SYSTEM_ERR">
            <PatternLayout pattern="${dfltPattern}" />
        </Console>
    </Appenders>

    <Loggers>
        <Logger name="io.emeraldpay" level="${env:DSHACKLE_LOG_LEVEL:-info}" additivity="false">
            <AppenderRef ref="STDOUT"/>
            <AppenderRef ref="STDERR" level="warn"/>
        </Logger>

        <!-- Reactor Netty produces warnings that are ok,
             ex. when Dshackle closes a connection too fast and Reactor Netty HTTPClient doesn't like that -->
        <Logger name="reactor.netty.http.client" level="error" additivity="false">
            <AppenderRef ref="STDOUT"/>
            <AppenderRef ref="STDERR" level="warn"/>
        </Logger>

        <Root level="warn" additivity="false">
            <AppenderRef ref="STDOUT"/>
            <AppenderRef ref="STDERR" level="warn"/>
        </Root>
    </Loggers>

</Configuration>