<div dir="ltr">Can't you make test config files? Like log4j-test.xml, logback-test.xml, log4j2-test.xml, etc. Those take precedence over the normal file when present, so including them in the test classpath works as expected.</div><div class="gmail_extra"><br><div class="gmail_quote">On 23 August 2017 at 18:52, Steven Schlansker <span dir="ltr"><<a href="mailto:sschlansker@opentable.com" target="_blank">sschlansker@opentable.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class=""><br>
> On Aug 23, 2017, at 4:49 PM, Mike Mills <<a href="mailto:mike@themills.id.au">mike@themills.id.au</a>> wrote:<br>
><br>
> Hi,<br>
><br>
> I have been using the Log4j-test library but I have found that it just is not flexible enough in most real world use cases.<br>
><br>
> When you include this library in your test scope, gradle and maven will by default create a classpath with your normal runtime slf4j implementation and the log4j-test implementation on the classpath during tests.<br>
><br>
><br>
> Would it be possible to modify the LoggerFactory.bind code to identify the test variant and use it in preference to any other implementations on the classpath?<br>
<br>
</span>You'd probably be better off changing your normal runtime implementation to be <scope>runtime</scope> in your Maven POM<br>
than expecting the binder to change. We've had really good success including logback as runtime scope and slf4j-simple as test scope.<br>
<br>
<br>
<br>______________________________<wbr>_________________<br>
slf4j-user mailing list<br>
<a href="mailto:slf4j-user@qos.ch">slf4j-user@qos.ch</a><br>
<a href="http://mailman.qos.ch/mailman/listinfo/slf4j-user" rel="noreferrer" target="_blank">http://mailman.qos.ch/mailman/<wbr>listinfo/slf4j-user</a><br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature" data-smartmail="gmail_signature">Matt Sicker <<a href="mailto:boards@gmail.com" target="_blank">boards@gmail.com</a>></div>
</div>