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