13 messages in org.apache.logging.log4j-userRe: Log4j category for a thread
FromSent OnAttachments
Tony ThompsonJun 7, 2004 8:30 pm 
Paul SmithJun 7, 2004 8:43 pm 
Tony ThompsonJun 8, 2004 6:11 am 
Ceki GülcüJun 8, 2004 7:20 am 
Tony ThompsonJun 8, 2004 8:00 am 
Ceki GülcüJun 8, 2004 8:36 am 
Tony ThompsonJun 8, 2004 9:06 am 
Paul SmithJun 8, 2004 3:21 pm 
Larry YoungJun 8, 2004 4:09 pm 
Tony ThompsonJun 8, 2004 5:31 pm 
Paul SmithJun 8, 2004 5:57 pm 
Sullivan, Sean C - MWTJun 8, 2004 6:04 pm 
Tony ThompsonJun 8, 2004 8:07 pm 
Actions with this message:
Paste this link in email or IM:
Paste this link in email or IM:
Atom feed for this thread
Paste this URL into your reader:
Subject:Re: Log4j category for a threadActions...
From:Ceki Gülcü (ce@qos.ch)
Date:Jun 8, 2004 8:36:52 am
List:org.apache.logging.log4j-user

At 05:00 PM 6/8/2004, Tony Thompson wrote:

What I am looking for is a way set a logger based on the thread of execution. In want to use this in a server process so, my example as a server:

void login() { Logger logger = LogManager.getLogger( "org.widgets.login" ); getUser(); ... }

void logout() { Logger logger = LogManager.getLogger( "org.widgets.logout" ); getUser(); ... }

void getUser() { // Which logger do I use? }

So, getUser() would "inherit" its Logger based on who calls it (thread of execution) not a parent object.

Pardon my asking but what is wrong with:

void getUser() { Logger logger = LogManager.getLogger( "org.widgets.getUser" ); }

or just

void getUser() { Logger logger = LogManager.getLogger( "org.widgets" ); }

Why should the logging in getUser() care if it has been called by login() or by logout()?

Please bear with me, I am trying to understand the use case.

-- Ceki Gülcü

For log4j documentation consider "The complete log4j manual" ISBN: 2970036908 http://www.qos.ch/shop/products/clm_t.jsp