On 7/3/07, Howard Lewis Ship wrote:
> And why would you inject loggers? Isn't each class supposed to declare its
> own logger?
That's a very limited view of a logger, that it's connected to the class.
Not very component thinking. Logging, especially the allocation of loggers,
is a concern that should be seperate from the class. Frequently in Tapestry
the same class will be configured differently for use as different services;
each of those should have a unique logger. Further, the same logger is used
to log the creation of a service and it's proxies/dependencies as is used at
runtime, this gives you the ability to trace the full lifecycle of a
particular service, rather than a class.
Indeed, and this has been the rationale behind the Logger/LogEnabled
abstraction in Apache Avalon.
http://excalibur.apache.org/apidocs/org/apache/avalon/framework/logger/Logger.html
if you look at that API you'll also see a method getChildLogger.
Basically it takes the logger injection thought a bit further,
allowing an Avalon component (or "service" in tap5 speak) to further
subdivide the logger hierarchy internally. This is cool, because I can
selectively turn on debug logging for one particular logical subsystem
of a service.
Now I know that Avalon is not that 'hot' any more, and a better API
could be designed width Java5 and varargs, but the general idea is
pretty nice.
Lars
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]