Hi,

I am interested in using my own custom LoggerFactory and I have been unable
to do so because of a bug that has been reported as 21707
(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=21707) and 13099
(http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13099).  I have prepared
a fix for this bug that is attached.  I have included both new source files
as well as diffs against the Aug 31, 2003 version of the affected files from
CVS.  Please consider adding this change to the current version of log4j in
CVS.

Here is a summary of the changes I made:

******
org.apache.log4j.spi.LoggerRepository.java

- added a new method
public void setDefaultLoggerFactory(LoggerFactory factory);

This method allows a Configurator to set the default LoggerFactory

****
org.apache.log4j.xml.DOMConfigurator.java

- modified to parse the loggerFactory tag and set the new default
LoggerFactory on the repository

****
org.apache.log4j.xml.log4j.dtd

- changed the "categoryFactory" tag to "loggerFactory" and moved it before
the category and logger tags so that the correct default LoggerFactory will
be used to create those categories and loggers.

******
org.apache.log4j.Hierarchy.java

- added impl for new setDefaultLoggerFactory method

******
org.apache.log4j.PropertyConfigurator.java

- modified the LoggerFactory configuration code to set the default
LoggerFactory on the LoggerRepository

*******
examples.subclass.MyLogger.java

- modified to use only the factory mechanism and not require use of
MyLogger.getCategory

*******
examples.subclass.MyLoggerTest.java

- modified the test to use only the factory mechanism and not require the
explicit use of MyLogger

********
examples.subclass.myloggerconfig.xml

- a config file that shows how to use the loggerFactory tag

********
examples.subclass.log4j.dtd

- copied the dtd so the config file can be parsed

Thanks,
Mark

Attachment: log4jdiffs.jar
Description: Binary data

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

Reply via email to