Hi Andrew,
Andrew Stevens wrote:
You seem to be missing the point of dependency injection - the TraxTransformer doesn't
look up its logger or specify its name or anything like that. It just declares "I want a logger"
(by implementing a "loggable" interface), and the component manager gives it
one.
So to do what you are suggesting would involve changing the component manager,
not
your transformer, so that it uses the label attribute or whatever to determine the logger
that it passes into the transformer after creating it.
What are you trying to achieve, though? If you just want your transformer to
use a different
name/category to the default TraxTransformer, why not just specify a different
logger=...
parameter when you declare your component in the map:transformers section of
your
sitemap?
We wrote our own framework using cocoon, inside the framework we are publishing
applications.
Each application uses its own log4j logger for debug output. The appropriate logger is created by an action, depending
on the application-path inside cocoon. Available transformers are defined for the framework, not for each application.
I'm able to set a logger for our Transformer using enableLogging(Logger) from interface "loggable". But since we are
using the Transformer quite a lot, it would be nice to distinguish the different Transformer calls.
Basically I want to achieve a logger hierarchy like:
<application>.MyTransformer.<label from sitemap>
Greetings Janne
Andrew.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]