Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
log4j: Route only subpackage to different appender
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" monitorInterval="30">
<Console name="ConsoleAppenderA" target="SYSTEM_OUT" follow="true">
<PatternLayout pattern="mainlog> %m%n%ex"/>
<Console name="ConsoleAppenderB" target="SYSTEM_OUT" follow="true">
<PatternLayout pattern="sublog> %m%n%ex"/>
<Logger name="com.example.demo" level="debug" >
<AppenderRef ref="ConsoleAppenderA" />
<Logger name="com.example.demo.sub" level="debug" additivity="false">
<AppenderRef ref="ConsoleAppenderB" />
<Root level="info">
<AppenderRef ref="ConsoleAppender" />
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.