[slf4j-user] Slf4j-test should be more convenient to use

Matt Sicker boards at gmail.com
Thu Aug 24 03:47:01 CEST 2017


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.

On 23 August 2017 at 18:52, Steven Schlansker <sschlansker at opentable.com>
wrote:

>
> > On Aug 23, 2017, at 4:49 PM, Mike Mills <mike at themills.id.au> wrote:
> >
> > Hi,
> >
> > 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.
> >
> > 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.
> >
> >
> > 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?
>
> You'd probably be better off changing your normal runtime implementation
> to be <scope>runtime</scope> in your Maven POM
> than expecting the binder to change.  We've had really good success
> including logback as runtime scope and slf4j-simple as test scope.
>
>
>
> _______________________________________________
> slf4j-user mailing list
> slf4j-user at qos.ch
> http://mailman.qos.ch/mailman/listinfo/slf4j-user
>



-- 
Matt Sicker <boards at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/slf4j-user/attachments/20170823/cacafa1e/attachment.html>


More information about the slf4j-user mailing list