logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Smith <psm...@aconex.com>
Subject Re: JUL Bridge Question
Date Fri, 09 Nov 2007 00:26:04 GMT

On 09/11/2007, at 11:18 AM, Joshua ChaitinPollak wrote:

> The JUL Log4j bridge has been working great for us, but I'm  
> wondering, doesn't it set the JUL root level logging to FINEST? If  
> that is the case, what if some 3rd party library has code like if  
> (log.isFinerEnabled() ) { doReallyExpensiveOperation(); } ?
>
> Would this mean that even if the log4j log level for that package is  
> at WARN, the 3rd party library would be doing the expensive  
> operation? Or does the JUL bridge pass the log4j configuration back  
> to JUL? If not, is that a reasonable feature to add?
>

During assimilation(), java.util.logging.LogManager is reset, which I  
think does set it to the default level, which according to the javadoc  
is the INFO level.  So I actually think the problem is the reverse,  
under the bridge it might not be possible for log4j to observe events  
lower than INFO.

That's at least worth a unit test to see what happens; I'll try and  
have a look (48 hours till our next product release at work - things  
are... busy.. :) )

We might need an assimilateAtLevel(Level) style operation that will  
set that level at the reset() event.. Thoughts?

cheers,

Paul



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message