logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Cheung, Quinn" <QChe...@rheinmetall.ca>
Subject RE: Logger name in the log entry
Date Mon, 23 Apr 2007 20:16:10 GMT
I'm afraid that doesn't work.  As I mentioned in the original mail, I don't want the class
name.  I want the name (identifier) of the logger. In my case I'm not using the class name
in the call to Logger.getLogger(), therefore the name of the logger is not the same as the
class name.




-----Original Message-----
From: James Stauffer [mailto:stauffer.james@gmail.com]
Sent: April 20, 2007 4:23 PM
To: Log4J Users List
Subject: Re: Logger name in the log entry


c: Used to output the category of the logging event.
C: Used to output the fully qualified class name of the caller issuing
the logging request.

On 4/20/07, Cheung, Quinn <QCheung@rheinmetall.ca> wrote:
> Using the PatternLayout and ConversionPattern, is there any way to automatically print
out the name of the logger that was used to log a message?  I know I can get the name of the
class which will coincide with the logger name if I do:
>
> Logger theLogger = getLogger( TheClassName.class );
>
> But I'm not doing that, I'm doing:
>
> Logger theLogger = getLogger( "HardCodedString" );
>
> and I want "HardCodedString" to appear each time theLogger logs a message.
>
> Thanks!
>
> Q.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


-- 
James Stauffer        http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

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


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


Mime
View raw message