logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From maskkkk <leean...@hotmail.com>
Subject log4j conversion specifiers and logger names
Date Wed, 29 Nov 2006 19:23:27 GMT

Lets say I'm in an application and I want to specify a in a class logger such
as follows:

> ...
> Logger log = Logger.getLogger("UseCase1");
> ...

Now lets suppose I want "UseCase1" to be displayed in the resulting log file
next to the log statements from the "UseCase1" logger.  Is there any way to
do this using a conversion specifier in log4j.xml?

>     		 &lt;layout class=&quot;org.apache.log4j.PatternLayout&quot;&gt;
> 		 	&lt;param name=&quot;ConversionPattern&quot; 
> value=&quot;[[[[%someConversionSpecifierWhichResultsInUseCaseAsLoggerName]]]]
> - %m%n&quot;/&gt;
> 	   &lt;/layout&gt;

Thank you, 

     Andrew J. Leer

View this message in context: http://www.nabble.com/log4j-conversion-specifiers-and-logger-names-tf2727234.html#a7606069
Sent from the Log4j - Users mailing list archive at Nabble.com.

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

View raw message