logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Matt Brown <Matt.Br...@citrixOnline.com>
Subject RE: Is there any way to output the log statemts from a particular method to a different log file other than what is configued for that package?
Date Thu, 16 Apr 2009 15:34:11 GMT
The point of using two different names is that then it allows you to configure these two loggers
differently in your configuration (either log4j.xml or log4j.properties or whatever other
method you are using to configure log4j).

If you give the loggers two different names, but they are still being treated the same, that
means that you have not updated your configuration to treat these two loggers differently.


-----Original Message-----
From: Vani Bandargal [mailto:vanims_98@hotmail.com] 
Sent: Thursday, April 16, 2009 10:57 AM
To: log4j-user@logging.apache.org
Subject: Re: Is there any way to output the log statemts from a particular method to a different
log file other than what is configued for that package?



yaog wrote:
> 
> In the log4j file add different logger definitions for MyLogger1 and 
> MyLogger2.
> 

you mean In log4J.properties or in log4J.xml?


yaog wrote:
> 
> He means this:
> 
> 
> public class OfflineMethodsDelegate extends BaseDelegate {
> 
>        private static Logger logger1 = 
> Logger.getInstance("MyLogger1");
> 
>        private static Logger logger2 = 
> Logger.getInstance("MyLogger2");
> 
> 
> 
> public void method1(UserInfo uInfo)throws DAOException {
>                logger1.debug("This is Method 1 Log");
> 
>        }
> 
> public void method2(UserInfo uInfo)throws DAOException {
>                logger2.debug("This is Method 2 Log");
> 
>        }
> 
> }
> 
> 
> 
Is not it the name given in Logger.getInstance is just arbitarary name and no mattter what
iou give , it will be written to the same file configured?
--
View this message in context: http://www.nabble.com/Is-there-any-way-to-output-the-log-statemts-from-a-particular-method-to-a-different-log-file-other-than-what-is-configued-for-that-package--tp23078688p23079687.html
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


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