> -----Original Message-----
> From: Geert Mergan [SMTP:[EMAIL PROTECTED]]
> Sent: Thursday, February 15, 2001 6:03 PM
> To:   'LOG4J Users Mailing List'
> Subject:      RE: adding custom priorities
> 
> A few reactions (while drowning in checking out all the possibilities to
> define custom priorities):
> 
> > (c)
> > If Ceki accepts the patch I submitted a week ago
> > (and he has indicated he will), then the
> > PropertyConfigurator will very soon be
> > able to use custom priority classes, like this:
> > log4j.category.fred = com.acme.Priority#TRACE, appender1
> 
> Simon:
> 
> Is this patch you talk about (see above) the same as the use-a-wrapper
> workaround you sent on the mailing list an hour ago?
> 
        [Kitching Simon]  
        No, the two subjects (priority patch, Category wrapper)
        are separate issues, though both to do with the use
        of custom priorities.

        The patch is for being able to configure Category and 
        Appender objects with custom priority objects from 
        Properties config files. Logging messages with custom 
        priorities is not much use if you can only set filtering 
        levels using the standard priority levels! As Ceki mentioned, 
        the DOMConfigurator can set filtering levels with custom 
        Priorities already, but PropertyConfigurator can't -- yet. 
        And DOMConfigurator still can't set Threshold attributes 
        on appenders using custom Priority objects -- yet.

        The "wrapper" approach is to do with accessing 
        custom Category objects from java code. 

        Note that the examples given by Jim Moore and  
        the examples in the distribution are proably better 
        style than my "wrapper" example. It was written a
        while ago, before improvements to log4j that made
        custom Category objects easier to write - and when I
        was still very new to log4j. However, it still avoids
        having to define a special CategoryFactory to avoid
        class-cast failures, which makes life a bit easier.

        And I think that in general, xml-based config files
        for log4j are the way to go. They are clearer to
        read, can be validated for correctness, can be
        edited using XML tools, and all sorts of useful
        stuff. I use xml config files everywhere - except
        in my applets, where an xml parser is just a 
        wee bit too large....

> Ceki:
> 
> 1) I've checked out the latest version from CVS and I've examined the
> examples you told me to.. They seem to use the DOMConfigurator. Maybe I'll
> use the XML based solution, even though I prefer standard properties
> files.
> 
> 2) It would be great to extend log4j so that you can also define custom
> priorities with the PropertiesConfigurator. This should be feasible using
> the AbstractFactory design pattern because in my opinion this can never be
> achieved with a simple getInstance() method.
> 
> 
> 
> ---------------------------------------------------------------------
> 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