[logback-user] Suppress or redirect Logback's internal status messages?

Robert Elliot rob at lidalia.org.uk
Wed Aug 4 18:53:50 CEST 2010


Logback is incorrectly trying to warn you that you have placed two logback.xml files on the classpath.  (It does this because if you had (you haven't) it would be a deployment error, as you might get random behaviour if the configuration files were different depending on which got loaded first.)

However, the log you posted shows that in fact the "two" files are the same file.  This is a feature (bug?) of the WebLogic classloader - when you request resources it sometimes returns the same resource twice.  This leads Logback to warn you (wrongly) that you have provided two different versions of the file.

I personally believe Logback and SLF4J should simply fix this by using a Set rather than any other Collection to check for duplicates; partly because I am not sure it is actually a bug (the contract of ClassLoader.getResources does not actually state that the Enumeration<URL> it returns should contain no duplicates) and partly because I see no good reason not to.

You could raise a bug here: http://jira.qos.ch/secure/BrowseProject.jspa - I can't find one already.  However, the corresponding bug in SLF4J (http://bugzilla.slf4j.org/show_bug.cgi?id=138) isn't getting a lot of love.

I believe there is no way to suppress Logback warnings.  So short of forking Logback or moving off WebLogic I'm not sure there's much you can do unless it gets fixed in a later version of Logback/Weblogic.

----- Original Message -----
From: "Derek Mahar" <derek.mahar at gmail.com>
To: "logback users list" <logback-user at qos.ch>
Sent: Wednesday, 4 August, 2010 5:29:58 PM
Subject: Re: [logback-user] Suppress or redirect Logback's internal status	messages?

Yes, I'm using WebLogic server.  Are you suggesting that SLF4J is
loading and configuring Logback twice?  If this were the case,
wouldn't I see duplicates of all of Logback's status messages?  Do you
know how I can fix this problem?

Derek


More information about the Logback-user mailing list