Folks,<div><br></div><div>I've been tinkering with both log4j and more recently logback and I was wondering whether or not it is possible to configure it in such a way that it would be possible for a single logger to write to multiple appenders using different LEVEL restrictions on a per-appender-ref basis. I appreciate that it is possible to specify a LEVEL attribute for each individual logger - but then any message which meets the logger LEVEL criteria will be sent to all referenced appenders. I'm also aware that you can define level thresholds and filters on a per-appender basis - but what I was hoping for was rather than define lots of very similar appender configurations (each with slightly different thresholds) that I could define a smaller number of core appenders and have messages of certain levels filtered out even before the appender is called.</div>

<div><br></div><div>To help illustrate the concept I'm aiming for, I've included a pseudo-configuration file below. You'll notice that I've omitted the LEVEL attribute from the <logger/> nodes and added LEVEL attributes to each of the <appender-ref> nodes - this doesn't work obviously, but I was wondering if there was some other way of emulating the behaviour that I'm after without cluttering up the logback configuration too much...? You can see from the configuration that for com.myorg.myapp.subpackage.one I would like to apply different log level restrictions depending on the destination appender. You'll also notice that for com.myorg.myapp.subpackage.two I want to reuse the same appenders, but also use different level restrictions.... hope that makes it clear enough...</div>

<div><br></div><div>---------</div><div><br></div><div><appender name="A"></div><div>  ...</div><div>  ...</div><div></appender></div><div><br></div><div><div><appender name="B"></div>

<div>  ...</div><div>  ...</div><div></appender></div></div><div><br></div><div><logger name="com.myorg.myapp.subpackage.one"></div><div>  <appender-ref ref="A" LEVEL="INFO"/></div>

<div>  <appender-ref ref="B" LEVEL="DEBUG"/>
</div><div></logger></div><div><br></div><div><div><logger name="com.myorg.myapp.subpackage.two"></div><div>  <appender-ref ref="A" LEVEL="WARN"/></div><div>  <appender-ref ref="B" LEVEL="TRACE"/></div>

<div></logger></div></div><div><br></div><div>----------</div><div><br></div><div>Regards,</div><div><br></div><div>Shane</div><div><br></div>