Andrew Scherpbier wrote:

> The object reference and method call are still performed even if nothing 
> gets logged.  By using a simple test, that overhead is removed if it is 
> not needed.
> This is actually a big deal.  It is even better if the test can be done 
> on a constant, because then the compiler can decide if the code needs to 
> be included or not and there is no overhead if the constant is false.


Using compile time constants to turn diagnostics on and off is something 
of a hot point for me - it can make it very difficult to diagnose 
problems in typical production environments in the companies I work with 
(rebuilding the app. server to get diagnostics is a no-happen)

from the log4j FAQ: "... evaluating a category takes less than 1% of the 
time it takes to actually log a statement."

There are a _few_ places in the JBoss code where I'd worry about this 
overhead, but not too many.

Actually, in the deployer, I wouldn't bother with the test at all.


> 
> marc fleury wrote:
> 
>> ???
>>
>> I have a conflict on ServiceDeployer.java
>>
>> the conflict is due to the inclusion of "if (debug) log.debug(...)"
>>
>> with debug being log.isDebugEnabled()...
>>
>> do we need to explicitely do that? I thought part of the interest is that
>> the log4j thing would not do anything with the messages if debug was not
>> enabled so why the explicit test?
>>
>> I will remove these unless something clearly says the contrary
>>
>> marcf
>>
>> xxxxxxxxxxxxxxxx
>> Marc Fleury
>> President
>> JBoss Group, LLC
>> xxxxxxxxxxxxxxxx
>>
>>
>> _______________________________________________
>> Jboss-development mailing list
>> [EMAIL PROTECTED]
>> https://lists.sourceforge.net/lists/listinfo/jboss-development
>>
> 
> 
> 
> 
> _______________________________________________
> Jboss-development mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-development



_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to