[ 
https://issues.apache.org/jira/browse/QPID-8017?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16244082#comment-16244082
 ] 

Keith Wall commented on QPID-8017:
----------------------------------

The reason the JUL logging events that have severity lower than INFO emitted 
from JE are not included in the broker's log is that the JUL 
{{java.util.logging.Logger#isLoggable#isLoggable()}} which considers only 
{{java.util.logging.Logger#levelValue}}.  It does not consult the JUL handlers, 
so Broker's J logger providers never get to get a call.  The INFO default comes 
from the JVM {{${JAVA_HOME}/jre/lib/logging.properties}}

I suspect the change I suggested above would have unacceptable performance 
implications.  The JE implementation takes care to guard detailed logging 
statements but the effect of the change would be to make the 
{{logger.isLoggable(logLevel)}} guards return true, making the cost of the 
construction of the log message is paid even if logging is turned off.

For a general purpose solution the only solution I see is reflecting the logger 
configuration from the Broker/VirtualHostLogger world into the JUL world every 
time there is configuration change (or on first start-up).  The algorithm would 
look like this:

{code}
foreach registered JUL loggers { java.util.logging.LogManager#getLoggerNames}}
{
   Get the SLF4J logger for the registered JUL logger name
   // Test the logging level configured on the SLF4J logger and reflect on to 
the JUL logger e.g.
    if (SLF4JLogger.isDebugEnabled())
    { 
        JULLogger.setLevel(convertSLF4JToJULLevel(DEBUG));
    } 
    else if (SLF4JLogger.isInfoEnabled())
    {
     ....
    }
}
{code}

This would be general purpose code and would not need to know about JE.   If 
Qpid integrated any other component using JUL logging, this approach would work 
unchanged.

> [Broker-J] [BDB]  JE log events written at JUL level FINE and below not 
> included in the log produced by a BrokerLogger
> ----------------------------------------------------------------------------------------------------------------------
>
>                 Key: QPID-8017
>                 URL: https://issues.apache.org/jira/browse/QPID-8017
>             Project: Qpid
>          Issue Type: Bug
>          Components: Java Broker
>    Affects Versions: qpid-java-6.1, qpid-java-broker-7.0.0
>            Reporter: Keith Wall
>            Priority: Minor
>
> Reproduction:
> * Add {{NameAndLevel}} logger inclusion rule BrokerLogger {{file}} for source 
> {{com.sleepycat.je.*}} with Level.ALL
> * Add a BDB HA VHN/VHN
> * Expected behaviour:  verbose logging from JE.  Actual behaviour:  moderate 
> logging only
> For instance, JE writes the following message at {{FINE}} which should be 
> logged by the handler as {{TRACE}}  but it is absent.
> {noformat}
> 2017-11-07 10:42:15,467 TRACE [Cleaner-1] (c.s.j.c.UtilizationCalculator) - 
> [default] Clean file none: predicted min util is below minUtilization, 
> current util min: 20 max: 20, predicted util min: 20 max: 20
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@qpid.apache.org
For additional commands, e-mail: dev-h...@qpid.apache.org

Reply via email to