Bugs item #653047, was opened at 2002-12-13 00:34
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=653047&group_id=22866

Category: JBossServer
Group: v3.0 Rabbit Hole
>Status: Closed
>Resolution: Remind
Priority: 5
Submitted By: Sebastian Hauer (hauer)
>Assigned to: Ceki Gulcu (cgu)
Summary: log4j .isDebugEnabled() will return true

Initial Comment:

After doing some testing I found out that no matter
which class I used to obtain a log category, either
"org.apache.log4j.Category", "org.apache.log4j.Logger"
or "org.jboss.logging.Logger"  once I did a:

log.isDebugEnabled() 

it would always return true.

Though as I logged with:

log.debug();

it would not show up in the log output. So the internal
check in debug() seems to work fine. 

I also tested whether "org.jboss.logging.Logger"
isTraceEnabled() behaves that way. But it does not. It
would return false as expected.

If I run a standalone application with log4j output
isDebugEnabled() will actually work as expected.

Attached you will find a little test case with 3 MBeans
distributed as source with a little ant build file.
The build will create a .sar file that can be deployed
into jboss.
I did only test on 3.0.4 so far.

I hope this was the right bug category.


----------------------------------------------------------------------

Comment By: Sebastian Hauer (hauer)
Date: 2002-12-13 15:21

Message:
Logged In: YES 
user_id=351964

Well even though I think I am familiar with log4j and I've
used it for quite a while now I have to admit that you are
right.
The logger category was not explicitly set to DEBUG level
but inherited the root categories log level. Which if not
set defaults to DEBUG. Out of some reason I must have been
under the impression that it would default to INFO. I guess
I got confused because of the appenders INFO threshold.
Sorry for that.

Maybe as a suggestion to avoid this mistake by others the
default log4j configuration shipped with JBoss should set
the ROOT categories log level explicitly either to DEBUG or
INFO so that one is aware of it.
Making heavy use of debug level logging in our application
it can have a significant performance impact log4j if one is
not aware of this.
cgu thanks a lot  for your reply and for making me
understand this.

----------------------------------------------------------------------

Comment By: Ceki Gulcu (cgu)
Date: 2002-12-13 01:10

Message:
Logged In: YES 
user_id=14048

logger.isDebugEnabled() will always return true if the logger is 
indeed enabled for the debug level. Do I understand the bug 
correctly? Otherwise, are you at all familiar with how log4j 
works?  (No offense indtended, just a question).

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=376685&aid=653047&group_id=22866


-------------------------------------------------------
This sf.net email is sponsored by:
With Great Power, Comes Great Responsibility 
Learn to use your power at OSDN's High Performance Computing Channel
http://hpc.devchannel.org/
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to