<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" xmlns:xi="http://www.w3.org/2001/XInclude">
    <Appenders>
        <xi:include href="log4j2-includes/console-appender_pattern-layout_colored.xml"/>
        <Console name="ConsoleRedAppender" target="SYSTEM_OUT">
            <PatternLayout pattern="%style{%message}{red}%n"/>
            <MarkerFilter marker="CONN_TRACE"/>
        </Console>
        <Console name="ConsoleGreenAppender" target="SYSTEM_OUT">
            <PatternLayout pattern="%style{userId=%X{userId}:}{white} %style{%message}{green}%n"/>
        </Console>
    </Appenders>
    <Loggers>
        <Logger name="ConnTrace" level="TRACE" additivity="false">
            <AppenderRef ref="ConsoleRedAppender"/>
        </Logger>
        <Logger name="UserAudit" level="INFO" additivity="false">
            <AppenderRef ref="ConsoleGreenAppender"/>
            <ThreadContextMapFilter>
                <KeyValuePair key="userId" value="1000"/>
            </ThreadContextMapFilter>
        </Logger>
        <Root level="DEBUG">
            <AppenderRef ref="ConsoleAppender"/>
        </Root>
    </Loggers>
</Configuration>
