[logback-user] Logback defaulting to debug mode for some third party libraries

amit shah amits.84 at gmail.com
Tue Jul 16 13:59:08 CEST 2013


On troubleshooting further I released that hibernate and apache client
libraries use the default logger context created during the initialization
time. This logger context has the root log level set to DEBUG.
We use JNDI as the context selector.

It is strange that the context name is not found at runtime when the
ConnectionManager class (hibernate class -
org.hibernate.jdbc.ConnectionManager) tries to instantiate a logger. Logger
instance creation calls ContextJNDISelector.getLoggerContext() method. This
method does a JNDI lookup but does not find the entry.

I troubleshooted further by spawning a thread in a servlet context listener
to print the JNDI entry (java:comp/env/logback/context-name) every 3
seconds. The logs from the thread indicate that the JNDI entries are always
present.

Any ideas why is contextName is not found in JNDI when queried by
ContextJNDISelector?



On Sat, Jul 13, 2013 at 10:19 AM, amit shah <amits.84 at gmail.com> wrote:

> We use slf4j and logback for logging in our java ee web application.
> Recently in order to move these libraries to a common location in the
> glassfish app server (to glassfish\lib directory specifically) we made a
> couple of configuration changes. We made changes in the web.xml file to add
> JNDI entries and renamed the logback.xml to logback-<context-name>.xml as
> specified in here <http://logback.qos.ch/manual/loggingSeparation.html>.
> The logback-<context-name>.xml is placed in WEB-INF\classes directory.
>
> After this change, logging for hibernate and http-client libraries is
> defaulting to debug mode and hence there is lot of logging being done. The
> root logger has INFO log level and there are no specific loggers defined
> for hibernate & http-client libraries.
>
> If I revert this change i.e. remove the jndi entry in web.xml and rename
> the configuration file to logback.xml, only INFO logs are logged as
> expected.
>
> Any suggestions on what could be the issue?
>
> Thanks,
> Amit.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.qos.ch/pipermail/logback-user/attachments/20130716/2b75c6a0/attachment.html>


More information about the Logback-user mailing list