<Configuration xmlns="http://logging.apache.org/log4j/2.0/config" >
    <Appenders>
        <Console name="ConsoleInfo" target="SYSTEM_OUT">
            <PatternLayout pattern="- %d{HH:mm:ss,SSS} %-20c{1} -- %msg%n"/>
            <Filters>
                <LevelMatchFilter level="INFO" onMatch="ALLOW" onMismatch="DENY"/>
                <MarkerFilter marker="PROCESS" onMatch="DENY" onMismatch="NEUTRAL" />
                <MarkerFilter marker="QUERY" onMatch="DENY" onMismatch="NEUTRAL" />
                <MarkerFilter marker="HTTP" onMatch="DENY" onMismatch="NEUTRAL" />
                <MarkerFilter marker="CRAWLER" onMatch="DENY" onMismatch="NEUTRAL" />
                <MarkerFilter marker="CONVERTER" onMatch="DENY" onMismatch="NEUTRAL" />
            </Filters>
        </Console>
        <Console name="ConsoleWarn" target="SYSTEM_OUT">
            <PatternLayout pattern="⚠ %d{HH:mm:ss,SSS} %-20c{1} -- %msg%n"/>
            <Filters>
                <LevelMatchFilter level="WARN" onMatch="ALLOW" onMismatch="DENY"/>
                <MarkerFilter marker="PROCESS" onMatch="DENY" onMismatch="NEUTRAL" />
                <MarkerFilter marker="QUERY" onMatch="DENY" onMismatch="NEUTRAL" />
                <MarkerFilter marker="HTTP" onMatch="DENY" onMismatch="NEUTRAL" />
                <MarkerFilter marker="CRAWLER" onMatch="DENY" onMismatch="NEUTRAL" />
                <MarkerFilter marker="CONVERTER" onMatch="DENY" onMismatch="NEUTRAL" />
            </Filters>
        </Console>
        <Console name="ConsoleError" target="SYSTEM_OUT">
            <PatternLayout pattern="🔥 %d{HH:mm:ss,SSS} %-20c{1} -- %msg%n"/>
            <Filters>
                <LevelMatchFilter level="ERROR" onMatch="ALLOW" onMismatch="DENY"/>
                <MarkerFilter marker="PROCESS" onMatch="DENY" onMismatch="NEUTRAL" />
                <MarkerFilter marker="QUERY" onMatch="DENY" onMismatch="NEUTRAL" />
                <MarkerFilter marker="HTTP" onMatch="DENY" onMismatch="NEUTRAL" />
                <MarkerFilter marker="CRAWLER" onMatch="DENY" onMismatch="NEUTRAL" />
                <MarkerFilter marker="CONVERTER" onMatch="DENY" onMismatch="NEUTRAL" />
            </Filters>
        </Console>
        <Console name="ConsoleFatal" target="SYSTEM_OUT">
            <PatternLayout pattern="💀 %d{HH:mm:ss,SSS} %-20c{1} -- %msg%n"/>
            <Filters>
                <LevelMatchFilter level="FATAL" onMatch="ALLOW" onMismatch="DENY"/>
                <MarkerFilter marker="PROCESS" onMatch="DENY" onMismatch="NEUTRAL" />
                <MarkerFilter marker="QUERY" onMatch="DENY" onMismatch="NEUTRAL" />
                <MarkerFilter marker="HTTP" onMatch="DENY" onMismatch="NEUTRAL" />
                <MarkerFilter marker="CRAWLER" onMatch="DENY" onMismatch="NEUTRAL" />
                <MarkerFilter marker="CONVERTER" onMatch="DENY" onMismatch="NEUTRAL" />
            </Filters>
        </Console>
        <Console name="ProcessConsole" target="SYSTEM_OUT">
            <PatternLayout pattern="%style{%msg%n}{FG_Cyan}"/>
            <Filters>
                <MarkerFilter marker="PROCESS" onMatch="ALLOW" onMismatch="DENY" />
            </Filters>
        </Console>
        <RollingFile name="LogToFileService" fileName="${env:WMSA_LOG_DIR:-/var/log/wmsa}/wmsa-${sys:service-name}-${env:WMSA_SERVICE_NODE:-0}.log" filePattern="/var/log/wmsa/wmsa-${sys:service-name}-${env:WMSA_SERVICE_NODE:-0}-log-%d{MM-dd-yy-HH-mm-ss}-%i.log.gz"
                     ignoreExceptions="false">
            <PatternLayout>
                <Pattern>%-5level %d{yyyy-MM-dd HH:mm:ss,SSS} %-20t %-20c{1}: %msg{nolookups}%n</Pattern>
            </PatternLayout>
            <SizeBasedTriggeringPolicy size="10MB" />
            <Filters>
                <MarkerFilter marker="PROCESS" onMatch="DENY" onMismatch="NEUTRAL" />
                <MarkerFilter marker="QUERY" onMatch="DENY" onMismatch="NEUTRAL" />
                <MarkerFilter marker="HTTP" onMatch="DENY" onMismatch="NEUTRAL" />
                <MarkerFilter marker="CRAWLER" onMatch="DENY" onMismatch="NEUTRAL" />
                <MarkerFilter marker="CONVERTER" onMatch="DENY" onMismatch="NEUTRAL" />
            </Filters>
        </RollingFile>
        <RollingFile name="LogToFileCrawler" fileName="${env:WMSA_LOG_DIR:-/var/log/wmsa}/crawler-audit-${env:WMSA_SERVICE_NODE:-0}.log" filePattern="/var/log/wmsa/crawler-audit-${env:WMSA_SERVICE_NODE:-0}-log-%d{MM-dd-yy-HH-mm-ss}-%i.log.gz"
                     ignoreExceptions="false">
            <PatternLayout>
                <Pattern>%d{yyyy-MM-dd HH:mm:ss,SSS}: %msg{nolookups}%n</Pattern>
            </PatternLayout>
            <SizeBasedTriggeringPolicy size="100MB" />
            <Filters>
                <MarkerFilter marker="CRAWLER" onMatch="ALLOW" onMismatch="DENY" />
            </Filters>
        </RollingFile>
        <RollingFile name="LogToFileConverter" fileName="${env:WMSA_LOG_DIR:-/var/log/wmsa}/converter-audit-${env:WMSA_SERVICE_NODE:-0}.log" filePattern="/var/log/wmsa/converter-audit-${env:WMSA_SERVICE_NODE:-0}-log-%d{MM-dd-yy-HH-mm-ss}-%i.log.gz"
                     ignoreExceptions="false">
            <PatternLayout>
                <Pattern>%d{yyyy-MM-dd HH:mm:ss,SSS}: %msg{nolookups}%n</Pattern>
            </PatternLayout>
            <SizeBasedTriggeringPolicy size="100MB" />
            <Filters>
                <MarkerFilter marker="CONVERTER" onMatch="ALLOW" onMismatch="DENY" />
            </Filters>
        </RollingFile>
    </Appenders>
    <Loggers>
        <Logger name="org.apache.zookeeper" level="WARN" />
        <Logger name="org.apache.pdfbox" level="ERROR" />
        <Logger name="org.apache.fontbox.ttf" level="ERROR" />
        <Root level="info">
            <AppenderRef ref="ConsoleInfo"/>
            <AppenderRef ref="ConsoleWarn"/>
            <AppenderRef ref="ConsoleError"/>
            <AppenderRef ref="ConsoleFatal"/>
            <AppenderRef ref="ProcessConsole"/>
            <AppenderRef ref="LogToFileService"/>
            <AppenderRef ref="LogToFileConverer"/>
            <AppenderRef ref="LogToFileCrawler"/>
        </Root>
    </Loggers>
</Configuration>