logging-log4j-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ralph Goers <ralph.go...@dslextreme.com>
Subject Re: OptionHandler equivalent in Log4j2?
Date Mon, 06 Aug 2012 04:11:29 GMT
No. component configuration in Log4j 2 is much different than in Log4j 1.x.  Plugins use factory
methods to instantiate the objects.  http://logging.apache.org/log4j/2.x/manual/plugins.html
and/or http://logging.apache.org/log4j/2.x/manual/extending.html should document how you do
that but this is one area where I haven't written enough documentation.

Until the documentation is written the only suggestion I can make is to look at any of the
Appenders, Filters, Lookups, etc. for guidance.

One thing I will point out is that most components in log4j 2 don't have setter methods. Instead,
the factory passes all the parameters to the constructor and then the objects are as immutable
as possible.


On Aug 5, 2012, at 7:04 PM, Scott Deboy wrote:

> Does such a concept as a generic option handler exist in log4j2?  For configuration items
which are unknown, they can be resolved via reflection in log4j.  
> At the moment, I'm resolving issues in org.apache.log4j.component.plugins.Plugin, which
extends OptionHandler (working my way through things found in Receiver).
> Scott

View raw message