<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="info">
    <Properties>
        <Property name="defaultLogLevel">info</Property>
    </Properties>

    <ThresholdFilter level="trace"/>

    <Appenders>
        <Console name="Console-Appender" target="SYSTEM_OUT">
            <PatternLayout>
                <ScriptPatternSelector defaultPattern="[%-5level] %date{HH:mm:ss,SSS} [%t] (%F:%L) %c{2}.%method - %msg%n">
                    <Script name="MDCSelector" language="javascript"><![CDATA[
                    result = null;
                    if (!logEvent.getContextData().size() == 0) {
                        result = "WithMDC";
                    } else {
                        result = null;
                    }
                    result;
               ]]>
                    </Script>
                    <PatternMatch key="WithMDC" pattern="[%-5level] %date{HH:mm:ss,SSS} [%t] (%F:%L) %c{2}.%method - %msg %X%n"/>
                </ScriptPatternSelector>
            </PatternLayout>
            <ThresholdFilter level="trace"/>
        </Console>
    </Appenders>

    <Loggers>
        <Root level="${sys:defaultLogLevel}">
            <AppenderRef ref="Console-Appender" level="${sys:defaultLogLevel}"/>
        </Root>
    </Loggers>
</Configuration>