blob: 65c6827b86ee208e85658af2b6e1fdc8e53d0882 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<Configuration status="OFF" name="XMLConfigTest" monitorInterval="1">
<Appenders>
<RollingFile name="HostFile" fileName="target/${hostName}.log" filePattern="target/${hostName}-%d{MM-dd-yyyy}-%i.log">
<PatternLayout>
<Pattern>%d %p %C{1.} [%t] %m%n</Pattern>
</PatternLayout>
<Policies>
<OnStartupTriggeringPolicy />
<TimeBasedTriggeringPolicy interval="24" modulate="true" />
</Policies>
</RollingFile>
<Console name="STDOUT">
<PatternLayout pattern="%m MDC%X%n"/>
<Filters>
<MarkerFilter marker="FLOW" onMatch="DENY" onMismatch="NEUTRAL"/>
<MarkerFilter marker="EXCEPTION" onMatch="DENY" onMismatch="ACCEPT"/>
</Filters>
</Console>
<Console name="FLOW">
<PatternLayout pattern="%C{1}.%M %m %ex%n"/>
<Filters>
<MarkerFilter marker="FLOW" onMatch="ACCEPT" onMismatch="NEUTRAL"/>
<MarkerFilter marker="EXCEPTION" onMatch="ACCEPT" onMismatch="DENY"/>
</Filters>
</Console>
<File name="File" fileName="target/test.log">
<PatternLayout>
<Pattern>%d %p %C{1.} [%t] %m%n</Pattern>
</PatternLayout>
</File>
<List name="List">
</List>
<List name="HostTest">
<PatternLayout pattern="%d %p %C{1.} [%t] %m ${hostName}%n"/>
</List>
<List name="NoThrowable">
<PatternLayout pattern="%d %p %C{1.} [%t] %m%n%ex{0}"/>
</List>
</Appenders>
<Loggers>
<Logger name="org.apache.logging.log4j.test1" level="debug" additivity="false">
<ThreadContextMapFilter>
<KeyValuePair key="test" value="123"/>
</ThreadContextMapFilter>
<AppenderRef ref="STDOUT"/>
</Logger>
<Logger name="org.apache.logging.log4j.hosttest" level="debug" additivity="false">
<!-- User appender-ref alias to prove it works -->
<appender-ref ref="HostTest"/>
</Logger>
<Logger name="org.apache.logging.log4j.nothrown" level="debug" additivity="false">
<AppenderRef ref="NoThrowable"/>
</Logger>
<Logger name="org.apache.logging.log4j.core.LoggerTest" additivity="false">
<AppenderRef ref="List"/>
</Logger>
<Logger name="org.apache.logging.log4j.core" level="debug" additivity="false">
<AppenderRef ref="STDOUT"/>
</Logger>
<Logger name="org.apache.logging.log4j.test2" level="debug" additivity="false">
<AppenderRef ref="File"/>
</Logger>
<Logger name="org" level="error" additivity="true"/>
<Root level="trace">
<AppenderRef ref="List"/>
</Root>
</Loggers>
</Configuration>