On May 13, 2007, at 1:41 AM, Eric B. wrote:
I'm not entirely sure how to create my loggers such that the
repository
supports LoggerRepositoryEx. Is there something special I need
to do in
the
log4j.xml file to accomplish this? Are the watchdogs not yet
supported?
The problem isn't that your repository doesn't support
LoggerRepositoryEx. The problem is that it is not attached to a
repository at all. log4j 1.3 introduced the Component interface
and one
of the essential steps of a component initialization is calling
Component.setLoggerRepository() to connect the component to a
LoggerRepository.
So, if I understand this correctly, I would need to do something like:
Logger logger = Logger.get( "logger" );
ComponentBase comp = new ComponentBase();
comp.setLoggerRepository ( logger.getLoggerRepository());
??? That just doesn't seem right. Seems like I should need to get
the
ComponentBase from somewhere, but not quite sure from where....
FileWatchdog indirectly extends ComponentBase, you would need to call
its setLoggerRepository method.
FileWatchdog confiFileWatchdog = new FileWatchdog();
configFileWatchdog.setFile( log4j_xml_path );
configFileWatchdog.setLoggerRepository(LogManager.getLoggerRepository
());
configFileWatchdog.activateOptions();
The problem is that DOMConfiguration.configureAndWatch has seemed
to have
disappeared from Log4j 1.3 altogether. And the DOMConfiguration
has been
deprecated in exchange for JoranConfiguration, which also is
missing the
configureAndWatch method.
The methods are in the SVN HEAD, they might not have been in the last
alpha release. The entire body of DOMConfigurator.configureAndWatch
initializes a FileWatchdog, the act of adding the watchdog to the
PluginRegistry results in the FileWatchdog's setLoggerRepository
method being called.
I had no idea that 1.3 was geared to be discontinued altogether.
Should I
be abandoning 1.3 completely and revert to 1.2? I see there is
still active
dev on 1.3, however, so I am confused. Has there been any dev done
on 2.0
at all?
There was a thread in early April on log4j-dev (http://marc.info/?
t=117555885500003&r=1&w=2) that revisited the log4j 1.3's
predicament: Not a big enough change to address today's issues, too
many changes to be labeled just a minor release. log4j 1.3's been
stuck for years, a lot of effort has been applied to make it more
compatible with log4j 1.2 but really making it compatible with log4j
1.2 would require undoing things that make it log4j 1.3. Most of
the development activity in the past month has been to extract new
features from the log4j 1.3 code base and package them as companion
products for log4j 1.2. Have also been migrating the documentation
to a Maven driven process with content that would clearly explain
that log4j 1.3 is essentially abandoned.
log4j 2.0 development is in its infancy. The enhanced pattern layout
component prepared from log4j 1.3 sources for log4j 1.2 is being
hacked to flesh out log4j 2.0 concepts and interfaces, but it is not
yet functional.
Ceki Gulcu who was the prime mover in the log4j 1.3 development has a
competing log framework, logBACK (http://logback.qos.ch/), that is
likely what log4j 1.3 would have become but unshackled from any
compatibility expectations with log4j 1.2. If you really want
something log4j 1.3 like and don't care about log4j 1.2
compatibility, it may be an option.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]