logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael Erskine <michael.ersk...@ketech.com>
Subject RE: Circular Dependency through Appender
Date Thu, 17 Jul 2008 10:12:56 GMT
Ivan Alencar [mailto:ialencar@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.


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