1 Jun 2003 12:01
Re: Getting all the appenders in all the loggers
Avner BenHanoch <avner <at> kinor.com>
2003-06-01 10:01:35 GMT
2003-06-01 10:01:35 GMT
you can always put all appenders in something like Set (see java.util.Set and its implementation classes), then iterate on your set and get all the elements uniquely. ----- Original Message ----- From: "Preetham Kajekar" <preetham <at> cisco.com> To: "'Log4J Users List'" <log4j-user <at> jakarta.apache.org> Sent: Friday, May 30, 2003 2:23 PM Subject: RE: Getting all the appenders in all the loggers > > > > -----Original Message----- > > From: Vinodh Lakshminarayan [mailto:vinodhl <at> yahoo.com] > > Sent: Friday, May 30, 2003 5:27 PM > > To: Log4J Users List > > Subject: Re: Getting all the appenders in all the loggers > > > > > > > > Try the following code > > > > Logger logger = .......... file://Your logger > > I need to do it for all the loggers in the system. I know there is > getAllLoggers() in LogManager. I was wondering if there is any other way > of doing this coz with this approach, I may land up getting the same > appender twice (if is associated with 2 loggers) and consequently > rolling over twice. This can be avoided using a Hashtable etc, but more > importantly, the code will be more computation than necessary.(Continue reading)
RSS Feed