logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Debasis Das" <deb...@india.hp.com>
Subject RE: How to get Method Name and Class Name
Date Wed, 30 Apr 2003 12:24:47 GMT
Hello Ceki,
          It worked and thanks for that. 
	
Right now inside my wrapper class, I am using 

private Logger logger = Logger.getLogger("MyLogger"); 

to create a logger. Is this the right approach ?

Also I have one more query.

Based on the Level, I want to change the Appender. 
For example for different Levels of message(DEBUG, INFO etc), I want the
information to go to different files.
Can I do it through the proerties file, or 
I have to do it programatically ? 

Thanks for the help
Debasis



-----Original Message-----
From: Ceki Gülcü [mailto:ceki@qos.ch] 
Sent: Wednesday, April 30, 2003 5:44 PM
To: Log4J Users List
Subject: RE: How to get Method Name and Class Name



The caller is the wrapper itself.

For example:

package com.wombat;
public class Wrapper {

   static String FQCN = "com.wombat.Wrapper";

   Logger logger; // the logger being wrapped
   ....

   publiv void debug(Object msg) {
      logger.log(FQCN, Level.DEBUG, msg. null);
   }
   ....
}

At 08:06 AM 4/30/2003 -0400, you wrote:


>Ceki,
>
>Does this then mean that his wrapper needs to accept the caller's FQCN 
>on his logger methods, and pass them down into the Log4j method 
>described below?  Or is the "caller" you mention here the FQCN of the 
>wrapper itself.
>
>Mike
>
>
>--

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


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



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


Mime
View raw message