blob: e25983bc0480552bcbd57385ec7f78de3f74ea08 [file] [log] [blame]
////
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
////
[#org_apache_logging_log4j_core_config_ConfigurationFactory]
= `org.apache.logging.log4j.core.config.ConfigurationFactory`
Class:: `org.apache.logging.log4j.core.config.ConfigurationFactory`
Provider:: `org.apache.logging.log4j:log4j-core`
Factory class for parsed apiref:Configuration[] objects from a configuration file.
ConfigurationFactory allows the configuration implementation to be dynamically chosen in 1 of 3 ways:
. A system property named "log4j.
configurationFactory" can be set with the name of the ConfigurationFactory to be used.
. xref:.adoc[] can be called with the instance of the ConfigurationFactory to be used.
This must be called before any other calls to Log4j.
. A ConfigurationFactory implementation can be added to the classpath and configured as a plugin in the xref:.adoc[] category.
The apiref:Order[] annotation should be used to configure the factory to be the first one inspected.
See xref:org.apache.logging.log4j.core.config.xml.XmlConfigurationFactory.adoc[XmlConfigurationFactory] for an example.
If the ConfigurationFactory that was added returns null on a call to getConfiguration then any other ConfigurationFactories found as plugins will be called in their respective order.
DefaultConfiguration is always called last if no configuration has been returned.
[#org_apache_logging_log4j_core_config_ConfigurationFactory-implementations]
== Known implementations
* xref:../log4j-core/org.apache.logging.log4j.core.config.json.JsonConfigurationFactory.adoc[JsonConfigurationFactory]
* xref:../log4j-core/org.apache.logging.log4j.core.config.properties.PropertiesConfigurationFactory.adoc[PropertiesConfigurationFactory]
* xref:../log4j-core/org.apache.logging.log4j.core.config.xml.XmlConfigurationFactory.adoc[XmlConfigurationFactory]
* xref:../log4j-core/org.apache.logging.log4j.core.config.yaml.YamlConfigurationFactory.adoc[YamlConfigurationFactory]