You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Jim Moore <ji...@veritas.com> on 2001/07/08 22:13:26 UTC

RE: Is it possible to specify categoryFactory in the XML configur ation file ?

You don't specify the factory, but the class itself.

  <!-- Note the class attributes! -->
  <category name="category.to.log"
            class="MyCategory">
    <priority value ="debug"
              class="PriorityClass" />
  </category>


-----Original Message-----
From: Yuriy Larin [mailto:zeroman@nixsolutions.com]
Sent: Sunday, July 08, 2001 7:49 AM
To: log4j-user@jakarta.apache.org
Subject: Is it possible to specify categoryFactory in the XML configuration
file ?
Importance: High


Hi.

Is it possible to specify categoryFactory parameter in the XML configuration
file ?

How to make it, I don't see this ability in the log4j.dtd (1.1.3 version -
latest) although it's possible in the Property file as in the
...\log4j\examples\mycat.good??

Where is my fault ? I try ...\log4j\examples\MyCategory.java   and
MyCategoryFactory.java with XML configuration file.

I get error message:
log4j:ERROR Did you forget to set the factory in the config file?

Thanks for any help.

- Yuriy.

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org


Re: Is it possible to specify categoryFactory in the XML configuration file ?

Posted by Paul Glezen <pg...@atdial.net>.
If you need to perform additional configuration on the category factory
itself before it is used to create category instances, you would provide
the following entry:

<categoryFactory class="MyCategoryFactory">
   <param name="property1" value="value1"/>
   <param name="property2" value="value2"/>
</categoryFactory>

Of course, your factory better have Java Bean compliant setters called
property1 and property2.  Things work best when they are string
properties.

Jim Moore wrote:
> 
> You don't specify the factory, but the class itself.
> 
>   <!-- Note the class attributes! -->
>   <category name="category.to.log"
>             class="MyCategory">
>     <priority value ="debug"
>               class="PriorityClass" />
>   </category>
> 
> -----Original Message-----
> From: Yuriy Larin [mailto:zeroman@nixsolutions.com]
> Sent: Sunday, July 08, 2001 7:49 AM
> To: log4j-user@jakarta.apache.org
> Subject: Is it possible to specify categoryFactory in the XML configuration
> file ?
> Importance: High
> 
> Hi.
> 
> Is it possible to specify categoryFactory parameter in the XML configuration
> file ?
> 
> How to make it, I don't see this ability in the log4j.dtd (1.1.3 version -
> latest) although it's possible in the Property file as in the
> ...\log4j\examples\mycat.good??
> 
> Where is my fault ? I try ...\log4j\examples\MyCategory.java   and
> MyCategoryFactory.java with XML configuration file.
> 
> I get error message:
> log4j:ERROR Did you forget to set the factory in the config file?
> 
> Thanks for any help.
> 
> - Yuriy.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: log4j-user-help@jakarta.apache.org

-- 
Beware of bugs in the above code.  I have
only proved it correct, not tried it.
-Don Knuth

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: log4j-user-help@jakarta.apache.org