You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by "Klein, Scott @ TW" <sc...@L-3com.com> on 2002/07/29 17:56:47 UTC

HierarchyEventListener (new logger event?)

I am working on a component that tracks modifications to the log4j
hierarchy, for a variety of reasons, and while the HierarchyEventListener
allows me to see when appenders are being added/removed I might also require
being notified when loggers are either being requested/delivered or
initially created.

>From looking at the code, it seems like a trivial addition:
	1) add the appropriate methods to HierarchyEventListener interface
	2) add fire* methods in the Hierarchy class
	3) call the fire* methods at the appropriate time 
		- in the getLogger(String name, LoggerFactory factory)
method of Hierarchy.

This will allow me to get rid of my current process which updates from the
Hierarchy at intervals.

This is the first "customization" that I require which must involve the
log4j code, which I obviously don't want to do. The only other way I can
think of doing this (without touching log4j code) is to create a new
appender which will fire updates when a logger is *used* - not very pretty.

Does anyone have an alternative solution that would not involve me keeping
up my own Log4J code (all 2 classes), or is this something that people might
want/need in later releases?



thanks
scott

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>