[
https://issues.apache.org/jira/browse/LOG4J2-2590?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16818249#comment-16818249
]
Ralph Goers edited comment on LOG4J2-2590 at 4/15/19 6:23 PM:
--------------------------------------------------------------
That is on purpose. It is documenting the ConfigurationBuilder, which is the
recommended way to programmatically generate a Configuration. Creating a
configuration using builders can certainly be done but is actually much harder
as the ConfigurationBuilder uses the plugin system. To not do that you would
have to create a Configuration and make sure it is initialized properly and
then call the Builders or Factory methods for each component. You would have to
look at each component and determine if it has a builder (Builders became the
standard after the fact so many components still use factory methods) and then
instantiate the object in whatever way it requires. We aren't going to document
how to do that for each and every plugin. Once you have created all the
components and properly attached them to the configuration you would then have
to call the Configurator class to replace the current configuration with the
one you constructed.
was (Author: [email protected]):
That is on purpose. It is documenting the ConfigurationBuilder, which is the
recommended way to programmatically generate a Configuration. Creating a
configuration using builders can certainly be done but is actually much harder
as the ConfigurationBuilder uses the plugin system. To not do that you would
have to create a Configuration and make sure it is initialized properly and
then call the Builders or Factory methods for each component. You would have to
look at each component and determine if it has a builder (Builders became the
standard after the fact so many components still use factory methods) and then
instantiate the object in whatever way it requires. We aren't going to document
how to do that for each and every plugin.
> Improve programmatically API documentation
> ------------------------------------------
>
> Key: LOG4J2-2590
> URL: https://issues.apache.org/jira/browse/LOG4J2-2590
> Project: Log4j 2
> Issue Type: Improvement
> Components: Documentation
> Affects Versions: 2.11.2
> Reporter: Thomas Hartwig
> Priority: Minor
>
> I studied [https://logging.apache.org/log4j/2.x/manual/customconfig.html] but
> it is very limited. It "only" documents how to configure appenders via simple
> String attributes. However there is obviously an appender specific
> configuration API via the appender builder. Unfortunately on the page
> mentioned above there is no hint about this nor there are helpful example of
> this.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)