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

AW: AW: [xmlblaster] about Log & Jutils



Hello Cyrille,

> Else, there is a LogManager. What is it for ?
> Why we can't call Log method (error, info ...) to it, then it will
> dispatch calls to each LogChannel ??

The LogManager is a static object for accessing the LogChannel objects by
name.
This allows you to log at two different places of your code to e.g. two
different files by calling either LogManager.error("a", "Source A", "Big
problem!") or LogManager.error("b", "Source B", "Problem 2"), without
passing the LogChannel objects around.

Using the LogManager to send the log method calls to all registered
LogChannel objects could result in crazy log output, because the registered
LogChannel objects could come from 2 distinct moduls (maybe from 2 different
companies) running on the same JVM and if both use the LogManager they want
their output in 2 distinct files. If the output of one of the moduls
suddently occure in the other logfile that would be very confusing.

But while looking at this class, it will give you another possibility of
solving your problem!
Yust copy the source of "LogManager.java" and build your own
"LogManager???.java" and modify the behaviour of of the log methods error()
... so that each call to one of this methods is sent to all registered
LogChannel objects.
This may be even a faster way to get what you want, and you have not to
define a new configuration schema and can use the normal LogDeviceFile
object.

Regards,
Juergen Birkle