[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[xmlblaster] Logging (Factory)



Hi,
I have been taking a quick look at the logging, since I think it would
be nice to be able to hook in another logging system. The problem is,
that since the logging is tied to Global and to me the singleton global
is not something you want to use i an embedded envrionment, you will
have to have manuall access to the Glob for the component yoy would want
to hook antoher logger to.

What do you say about the following solution:

1. Define a LogDeviceFactory
public interface {
	LoggableDevive getLoggableDebice(LogChannel channel, Global glob);
}

2. Make is possible to define a LogDeviceFactory in properties, either
   one or many or even your [...] style, ie:

logDeviceFactory=my.pack.Log4jDeviceFactory
or
logDeviceFactory=my.pack.Log4jLogDeviceFactory,org.xmlBlaster.util.ConsoleLogDeviceFactory
or even
logDeviceFactory[cb]=org.xmlBlaster.util.ConsoleLogDeviceFactory


3. And in initLog in Global set up the LogDevice factory structure and
   use that if its available. 

That way the real implementation of the logging output would be detached
from the setup.

I could do the first simple implementation if you think this is ok.

(By the way, it seems to me as the logging is actually set up twice:

first in initLog and then when initLog calls       log.initialize(this);

Is this because there are old components that does not yet log through
Global?
)

//Peter
-- 
------------------------------------------------------------
Peter Antman	Chief Technology Officer, Development
Technology in Media, Box 34105 100 26 Stockholm
WWW: http://www.tim.se	WWW: http://www.backsource.org
Email: pra at tim.se	 
Phone: +46-(0)8-506 381 11 Mobile: +46-(0)704 20 58 11
------------------------------------------------------------