Nicola Ken Barozzi wrote:
Andrzej Jan Taramina wrote:

Antti said:

2. Logger, LogEnabled & Co.

I wouldn't include these in the core interfaces. Logger is just another
component that could be acquired through the context. This might also help
to reduce friction between different projects, as using Avalon wouldn't
force them to use a specific logging interface.

Absolutely agree.

Actually, I don't, but I still do %-)

Imagine that I (admion) have my happy Avalon container running services. Then I get a VeryNiceService and want to add it to my services.

What I would imagine is that I can manage the confifuration and the Logging in the same way as other services... oops, I cannot. I have to learn another logging package. Another configuration system. Blah.

Is this doable with Avalon4... nope ;-)


So, yes, I agree that the current way of doing things can be replaced as you say above. But what I would really like, is a way of managing the above things in a completely uniform manner.
I see your point, but dont't worry :) We could still have have our AbstractLoggable, but this time it could even support several logging implementations:

Object logger = context.get(LOGGER);
if (logger instanceof avalon.Logger) {
m_logger = (avalon.Logger) logger;
} else if (logger instanceof commons.Log) {
m_logger = new Commons2AvalonLogger((commons.Log) logger);
}

This would of course also work the other way round, i.e. you could put an instance of VeryNiceLogger2AvalonLogger to the context of VeryNiceService. However, if VeryNiceCompany had never heard of Avalon (or IoC), and used static factories for accessing the loggers, there'd be little we could do without changing the code.


Does this necessarily mean that I need a single logging interface?

Probably not. Put something like JMX in the picture and there is a place for uniform management.
Yes, JMX is nice. I think it should be the preferred management solution. The clear naming scheme also enables the container to automatically discover the correct MBean for a given component.

(: A ;)
--
Antti Koivunen (Mr.) <[EMAIL PROTECTED]>


--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to