Umair,

Thanks to your timely prompting I checked out what would be required to
enable DOMConfigurator to parse CategoryFactory entries in an XML file.
The following changes to DOMConfigurator should do it.

  - add a parseCategoryFactory(Element) method that
    would handle the creation of the factory and its
    configuration.
  - invoke parseCategoryFactory from parse(Element, Hierarchy)
  - add a string constant for the category factory tag

Also the log4j.dtd should be modified to reflect the new tag.

Presently the DOMConfigurator iterates over the child elements of the root
element checking for Category tags, root category tags and renderer tags.
It seems reasonable to add category factory tags to this list.  The only
unexpected behavior I know of to arise from this is if someone places a
category definition before a category factory definition (or if the child
element iterator encounters a category before it's corresponding factory).
Then parseCategory would use an unconfigured factory to create the
category.  A way to prevent this problem would be to make a separate walk
through the children of the root and check for factory tags.  Then do it
again for categories, roots and renderers as it is now.

If this sounds ok, I can implement it on Friday.  Tonight doesn't look good
and Thursday night I'll be travelling.

- Paul

Paul Glezen
IT Specialist
Software Services
818 539 3321


Umair Akeel <[EMAIL PROTECTED]> on 06/19/2001 02:57:09 PM

Please respond to "LOG4J Developers Mailing List"
      <[EMAIL PROTECTED]>

To:   "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
cc:
Subject:  Configure Category Factory for DOMConfigurator



I am working with Log4J and have extended the Category
class and to be able to use the DOMConfigurator class
I need to set the correct CategoryFactory.

Its current behaviour is to use the default category factory
from the Hierarchy. PropertyConfigurator on the other hand
has the ability to setup a FactoryClass. Doing this is not
at all difficult and I was wondering who should be contacted
to make this enhancement into the tree ?

Thanks a lot


Umair Akeel
Trigo, Inc.
8000 Marina Blvd.,  Suite 810
Brisbane, CA 94005
Tel: (650) 827-0500 x124
Fax: (650) 827-0501
[EMAIL PROTECTED]


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




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

Reply via email to