Berin Loritsch <[EMAIL PROTECTED]> writes:
[...]
As a result all modern Avalon Containers (i.e. Fortress, Merlin, and Phoenix) allow you to customize the logger category name for the component in question. Even ECM provides some support for that.
Ok. Can you show me a code snipped of how to do this? I'm quite happy with the fact that I can get a log file like this from an application (this is from Turbine, but the Torque code is the same):
In the configuration file, you can apply the "logger" attribute like this:
<service-broker logger="service.broker"/>
That way ECM will output everything to ${base.category} + ".service.broker".
In your case "avalon.service.broker".
2003-06-23 00:49:55,438 [HttpProcessor[8080][3]] INFO org.apache.turbine.services.BaseServiceBroker - Added Mapping for Service: TemplateService 2003-06-23 00:49:55,438 [HttpProcessor[8080][3]] INFO org.apache.turbine.services.BaseServiceBroker - Added Mapping for Service: VelocityService 2003-06-23 00:49:55,443 [HttpProcessor[8080][3]] INFO org.apache.turbine.services.BaseServiceBroker - Start Initializing service (early): AvalonComponentService
(i.e. Date, Thread, Level, Category). So I can separate these out by the thread if I want to debug an event sequence or by Category if I want to debug a certain component. I found out that if I don't put some marker for the class into the log, then sooner or later I will start to add a this.getClass().getName() to the logging messages to make sure that I found the right "Started!" or "Got here!" marker. :-)
:) The Excalibur Logger toolkit has a way to configure LogKit to make that happen. I don't have the exact configuration set up for you though.
If you are not using one of the three (Fortress and Phoenix are officially released, while Merlin is not released yet but is functional), then you should modify your container to allow you to customize your logger categories for the components.
Well, I somehow "inherited" the code which uses ECM. :-) I'd be going to another container in a second if it isn't too complicated. Being not too heavyweight would be another plus. Any recommendations for me?
If you are migrating from an ECM based infrastructure, I highly recommend using Fortress. It isn't too heavyweight, and it is designed to bring ECM users into the future of Avalon. In addition to using the "logger" attribute described above, it also supports a "startup" attribute so that you can tell Fortress to use immediate, asynchronous (default), and on-demand based initialization.
Furthermore, it is pretty trivial to set up using the FortressConfig class.
Phoenix is designed for standalone use, and Merlin has features that are similar or common to both Fortress and Phoenix--but it doesn't make it quite as easy to upgrade as Fortress does.
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
