logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Stauffer" <stauffer.ja...@gmail.com>
Subject Re: named logger .
Date Wed, 07 Mar 2007 14:57:59 GMT
> private static Log logger = LogFactory.getLog(MyClass.class);
That will produce a logger named after the fully qualified name of the
class (i.e. "com.acme.project.MyClass")

> private static Log logger = LogFactory.getLog("MY_LOGGER_NAME");
That will produce a logger named exactly "MY_LOGGER_NAME"

> and how to specify the same in the log4J.xml file.
Examples:
  <logger name="com.acme.project.MyClass">
  <logger name="MY_LOGGER_NAME">


On 3/7/07, Asif Mekrani <asif.mekrani@gmail.com> wrote:
> Hi Group,
>
> Please can you tell me how to use the names logger. means :
>
> Usually we use a class name for the logger name, eg:
>
> private static Log logger = LogFactory.getLog(MyClass.class);
>
> but wat if, I want to use a string name instead of the class name , i.e.
>
> private static Log logger = LogFactory.getLog("MY_LOGGER_NAME");
>
> and how to specify the same in the log4J.xml file.
>
> TIA.
>
> Smiles,
> Asif
>


-- 
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


Mime
View raw message