You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Scot Hale <ha...@hotmail.com> on 2001/08/01 00:50:25 UTC

FQCN Category.log() question

I currently converted the logging in my webapplication to use log4j 1.1.3 via a wrapper class.  So everything in the application, various packages, log via the function call in one class:

    Category.getRoot().log(String callerFQCN, Priority priority, Object message, Throwable t) 

I am running into a problem setting logging priorities for different categories, because everything is seen as coming from the category class root, instead of the passed Fully Qualified Class Name.

My properties are set up as:

log4j.rootCategory=FATAL,sizeAppender

log4j.category.a.subclass=DEBUG
log4j.additivity.a.subclass=false

Is there anyway to make a category priority under the rootCategory log, using the Category method log(String callerFQCN, Priority priority, Object message, Throwable t)?

Re: FQCN Category.log() question

Posted by Don Taylor <do...@yahoo.com>.
I think what you want to do is this:

Category.getInstance(callerFQCN).log(priority, message, t);

The problem with your approach is you're always working with the root
category, which isn't what you want.

-- Don 

--- Scot Hale <ha...@hotmail.com> wrote:
> I currently converted the logging in my webapplication to use log4j
> 1.1.3 via a wrapper class.  So everything in the application, various
> packages, log via the function call in one class:
> 
>     Category.getRoot().log(String callerFQCN, Priority priority,
> Object message, Throwable t) 
> 
> I am running into a problem setting logging priorities for different
> categories, because everything is seen as coming from the category
> class root, instead of the passed Fully Qualified Class Name.
> 
> My properties are set up as:
> 
> log4j.rootCategory=FATAL,sizeAppender
> 
> log4j.category.a.subclass=DEBUG
> log4j.additivity.a.subclass=false
> 
> Is there anyway to make a category priority under the rootCategory
> log, using the Category method log(String callerFQCN, Priority
> priority, Object message, Throwable t)?
> 


__________________________________________________
Do You Yahoo!?
Make international calls for as low as $.04/minute with Yahoo! Messenger
http://phonecard.yahoo.com/

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