17 Jul 12:12
RE: Circular Dependency through Appender
From: Michael Erskine <michael.erskine <at> ketech.com>
Subject: RE: Circular Dependency through Appender
Newsgroups: gmane.comp.jakarta.log4j.user
Date: 2008-07-17 10:12:56 GMT
Subject: RE: Circular Dependency through Appender
Newsgroups: gmane.comp.jakarta.log4j.user
Date: 2008-07-17 10:12:56 GMT
Ivan Alencar [mailto:ialencar <at> gmail.com] wrote: > I've created a log4j appender (by extending AppenderSkeleton) which uses a > component that depends on log4j. If you can change the component then one technique I sometimes use is to pass in a Logger object which may be null. Or I suppose one could temporarily set the static logger for that class to null while I'm accessing it from an Appender. You can always programmatically disable the Logger for the component's class too with Logger.getLogger(whatever).setLevel() Typically I try to write components that don't rely on any particular logging framework at runtime - keep it optional. Regards, Michael Erskine.
RSS Feed