////
    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

         http://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.
////
= Runtime Dependencies

++++
<link rel="stylesheet" type="text/css" href="css/tables.css">
++++

Some Log4j features depend on external libraries. This page lists the
required and optional dependencies.

The Log4j API is a Java module (with a module-info.java). Many of the other jars are also JPMS modules. The
characteristics of the modules are:

[cols="3h,5m,12a"]
|===
|Artifact Name |Module Name |Module Characteristics

|log4j-api
|org.apache.logging.log4j
|
[cols="m,"]
!===
!Module Directive !Notes

!exports org.apache.logging.log4j
!

!exports org.apache.logging.log4j.message
!

!exports org.apache.logging.log4j.simple
!

!exports org.apache.logging.log4j.spi
!

!exports org.apache.logging.log4j.status
!

!exports org.apache.logging.log4j.util
!Some classes in this package are used by the logging implementation and should be considered private.
The module info definition may be modified in the future to export these only to the logging implementation.

!requires static java.sql
!
!requires static org.osgi.framework
!

!uses org.apache.logging.log4j.spi.Provider
!Service that must be provided by the logging implementation.
!uses PropertySource
!Service that must be provided by the logging implementation.
!uses org.apache.logging.log4j.message.ThreadDumpMessage.ThreadInfoFactory
!Service that must be provided by the logging implementation.

!provides PropertySource with EnvironmentPropertySource, SystemPropertiesPropertySource
!
!===

|log4j-core
|org.apache.logging.log4j.core
|
[cols="m,"]
!===
!Module Directive !Notes

!exports org.apache.logging.log4j.core
!
!exports org.apache.logging.log4j.core.appender
!
!exports org.apache.logging.log4j.core.appender.db
!
!exports org.apache.logging.log4j.core.appender.nosql
!
!exports org.apache.logging.log4j.core.appender.rewrite
!
!exports org.apache.logging.log4j.core.appender.rolling
!
!exports org.apache.logging.log4j.core.appender.rolling.action
!
!exports org.apache.logging.log4j.core.appender.routing
!
!exports org.apache.logging.log4j.core.async
!
!exports org.apache.logging.log4j.core.config
!
!exports org.apache.logging.log4j.core.config.arbiters
!
!exports org.apache.logging.log4j.core.config.builder.api
!
!exports org.apache.logging.log4j.core.config.builder.impl
!
!exports org.apache.logging.log4j.core.config.composite
!
!exports org.apache.logging.log4j.core.config.json
!
!exports org.apache.logging.log4j.core.config.plugins
!
!exports org.apache.logging.log4j.core.config.plugins.convert
!
!exports org.apache.logging.log4j.core.config.plugins.util
!
!exports org.apache.logging.log4j.core.config.plugins.visit
!
!exports org.apache.logging.log4j.core.config.properties
!
!exports org.apache.logging.log4j.core.config.status
!
!exports org.apache.logging.log4j.core.config.xml
!
!exports org.apache.logging.log4j.core.config.yaml
!
!exports org.apache.logging.log4j.core.filter
!
!exports org.apache.logging.log4j.core.impl
!
!exports org.apache.logging.log4j.core.jmx
!
!exports org.apache.logging.log4j.core.layout
!
!exports org.apache.logging.log4j.core.lookup
!
!exports org.apache.logging.log4j.core.message
!
!exports org.apache.logging.log4j.core.net
!
!exports org.apache.logging.log4j.core.net.ssl
!
!exports org.apache.logging.log4j.core.osgi
!
!exports org.apache.logging.log4j.core.parser
!
!exports org.apache.logging.log4j.core.pattern
!
!exports org.apache.logging.log4j.core.script
!
!exports org.apache.logging.log4j.core.selector
!
!exports org.apache.logging.log4j.core.time
!
!exports org.apache.logging.log4j.core.tools
!
!exports org.apache.logging.log4j.core.tools.picocli
!
!exports org.apache.logging.log4j.core.util
!
!exports org.apache.logging.log4j.core.util.datetime
!

!// Required Dependencies
!
!requires transitive org.apache.logging.log4j
!
!requires transitive org.apache.logging.log4j.plugins
!
!// Optional Dependencies
!
!requires static java.desktop
!
!requires static java.management
!
!requires static java.sql
!
!requires static java.rmi
!
!requires static java.xml
!
!requires static com.lmax.disruptor
!
!requires static org.osgi.framework
!
!requires static com.conversantmedia.disruptor
!
!requires static com.fasterxml.jackson.core
!
!requires static com.fasterxml.jackson.databind
!
!requires static com.fasterxml.jackson.dataformat.xml
!
!requires static com.fasterxml.jackson.dataformat.yaml
!
!requires static org.apache.commons.compress
!
!requires static org.fusesource.jansi
!

!requires static jdk.unsupported
!

!uses ContextDataProvider
!
!uses WatchEventService
!
!uses ScriptManagerFactory
!
!provides ThreadInfoFactory with ExtendedThreadInfoFactory
!
!provides ContextDataProvider with ThreadContextDataProvider
!
!provides Provider with Log4jProvider
!
!provides PluginService with Log4jPlugins
!
!provides InjectorCallback with DefaultCallback
!
!===

|log4j-1.2-api
|org.apache.log4j
|Automatic Module - It is unlikely any application using JPMS would use Log4j 1.x.

|log4j-appserver
|org.apache.logging.log4j.appserver
|Automatic Module

|log4j-docker
|org.apache.logging.log4j.docker
|Automatic Module

|log4j-flume-ng
|org.apache.logging.log4j.flume
|Automatic Module

|log4j-iostreams
|org.apache.logging.log4j.iostreams
|Automatic Module

|log4j-jcl
|org.apache.logging.log4j.jcl
|Automatic Module

|log4j-jpl
|org.apache.logging.log4j.jpl
|
[cols="m,"]
!===
!Module Directive !Notes

!exports org.apache.logging.log4j.jpl to junit
!
!requires org.apache.logging.log4j
!
!requires transitive org.apache.logging.log4j.core
!
!provides java.lang.System.LoggerFinder with org.apache.logging.log4j.jpl.Log4jSystemLoggerFinder
!
!===

|log4j-jul
|org.apache.logging.log4j.jul
|
[cols="m,"]
!===
!Module Directive !Notes

!exports org.apache.logging.log4j.jul
!
!opens org.apache.logging.log4j.jul to org.apache.logging.log4j
!

!requires org.apache.logging.log4j
!
!requires org.apache.logging.log4j.core
!
!requires java.desktop
!
!requires java.logging
!
!===

|log4j-layout-template-json
|org.apache.logging.log4j.layout.template.json
|
[cols="m,"]
!===
!Module Directive !Notes

!exports org.apache.logging.log4j.layout.template.json
!
!exports org.apache.logging.log4j.layout.template.json.resolver
!
!exports org.apache.logging.log4j.layout.template.json.util
!

!opens org.apache.logging.log4j.layout.template.json
!
!opens org.apache.logging.log4j.layout.template.json.resolver
!
!opens org.apache.logging.log4j.layout.template.json.util
!

!requires org.apache.logging.log4j
!
!requires org.apache.logging.log4j.plugins
!
!requires org.apache.logging.log4j.core
!
!===

|log4j-plugin-processor
|org.apache.logging.log4j.plugin.processor
|
[cols="m,"]
!===
!Module Directive !Notes

!exports org.apache.logging.log4j.plugin.processor
!

!requires java.compiler
!
!requires org.apache.logging.log4j
!
!requires org.apache.logging.log4j.plugins
!
!requires transitive org.osgi.framework
!

!provides javax.annotation.processing.Processor with org.apache.logging.log4j.plugin.processor.PluginProcessor
!
!===

|log4j-plugins
|org.apache.logging.log4j.plugins
|
[cols="m,"]
!===
!Module Directive !Notes

!exports org.apache.logging.log4j.plugins
!
!exports org.apache.logging.log4j.plugins.condition
!
!exports org.apache.logging.log4j.plugins.convert
!
!exports org.apache.logging.log4j.plugins.di
!
!exports org.apache.logging.log4j.plugins.model
!
!exports org.apache.logging.log4j.plugins.name
!
!exports org.apache.logging.log4j.plugins.util
!
!exports org.apache.logging.log4j.plugins.validation
!
!exports org.apache.logging.log4j.plugins.validation.constraints
!
!exports org.apache.logging.log4j.plugins.validation.validators
!
!exports org.apache.logging.log4j.plugins.visit
!

!requires org.apache.logging.log4j
!
!requires static org.osgi.framework
!

!uses PluginService
!
!uses InjectorCallback
!
!===

|log4j-script
|org.apache.logging.log4j.script
|
[cols="m,"]
!===
!Module Directive !Notes

!exports org.apache.logging.log4j.script
!
!exports org.apache.logging.log4j.script.appender
!
!opens org.apache.logging.log4j.script.appender to org.apache.logging.log4j.core
!
!exports org.apache.logging.log4j.script.appender.rolling.action
!
!exports org.apache.logging.log4j.script.config.arbiter
!
!opens org.apache.logging.log4j.script.config.arbiter to org.apache.logging.log4j.core
!
!exports org.apache.logging.log4j.script.filter
!
!exports org.apache.logging.log4j.script.layout
!
!opens org.apache.logging.log4j.script.layout to org.apache.logging.log4j.core
!
!exports org.apache.logging.log4j.script.plugins
!

!requires org.apache.logging.log4j
!
!requires org.apache.logging.log4j.core
!
!requires org.apache.logging.log4j.plugins
!
!requires java.scripting
!

!provides PluginService with Log4jPlugins
!
!provides ScriptManagerFactory with ScriptManagerFactoryImpl
!
!===

|log4j-slf4j-impl
|org.apache.logging.log4j.slf4j.impl
|Automatic Module. May require renaming should SLF4J ever require all implementations to have the same module name.

|log4j-to-jul
|org.apache.logging.log4j.tojul
|
[cols="m,"]
!===
!Module Directive !Notes

!exports org.apache.logging.log4j.tojul to org.apache.logging.log4j, org.apache.logging.log4j.tojul.test
!

!requires org.apache.logging.log4j
!
!requires java.logging
!

!provides org.apache.logging.log4j.spi.Provider with org.apache.logging.log4j.tojul.JULProvider
!

!===

|log4j-to-slf4j
|org.apache.logging.log4j.slf4j
|Automatic Module

|===


log4j-api[[log4j-api]]::
The Log4j link:log4j-api/index.html[API] module has no required external dependencies.

log4j-core[[log4j-core]]::
The Log4j link:log4j-core/index.html[Implementation] has no required exterbak dependencies but has  several
optional link:log4j-core/dependencies.html[dependencies]. See the
link:log4j-core/dependencies.html#Dependency_Tree[Dependency Tree] for
the exact list of JAR files needed for these features.

.Optional Dependencies per Feature in Log4j Implementation
[cols="1,3"]
|===
|Feature |Requirements

|XML configuration
|-

|Properties configuration
|-

|JSON configuration
|https://github.com/FasterXML/jackson[Jackson core and databind]

|YAML configuration
|https://github.com/FasterXML/jackson[Jackson databind] and https://github.com/FasterXML/jackson-dataformat-yaml[YAML data format]

|CSV Layout
|https://commons.apache.org/proper/commons-csv/[Apache Commons CSV]

|XML Layout
|https://github.com/FasterXML/jackson[Jackson core, databind and dataformat XML] and `com.fasterxml.woodstox:woodstox-core:5.0.2`

|Async Loggers
|http://lmax-exchange.github.io/disruptor/[LMAX Disruptor]

|Windows console color support
|http://jansi.fusesource.org/[Jansi]

|JDBC Appender
|a JDBC driver for the database you choose to write events to

|NoSQL Appender with MongoDB provider
|MongoDB Java Client driver and Log4j MongoDB library

|Bzip2, Deflate, Pack200, and XZ compression on rollover
|http://commons.apache.org/proper/commons-compress/[Apache Commons Compress].
In addition, XZ requires http://tukaani.org/xz/java.html[XZ for Java].

|log4j-1.2-api[[log4j-1.2-api]]
|The link:log4j-1.2-api/index.html[Log4j 1.2 Bridge] has no external
dependencies. This only requires the Log4j API. Including Log4j Core provides optional, extra functionality.

|log4j-api-scala[[log4j-api-scala]]
|The Log4j link:manual/scala-api.html[Scala API] requires Scala runtime
library and reflection in addition to the Log4j API.

|log4j-docker
|link:log4j-docker/index.html[Log4j Docker Support] requires
https://github.com/FasterXML/jackson[Jackson annotations, core, and databind]. See the
link:log4j-docker/dependencies.html#Dependency_Tree[Dependency Tree] for the exact list of
JAR files needed.

|log4j-flume-ng[[log4j-flume-ng]]
|The link:log4j-flume-ng/index.html[Flume Appender] requires
http://flume.apache.org/[Apache Flume] and
http://avro.apache.org/[Apache Avro]. The persistent agent uses Berkeley DB. See the
link:log4j-flume-ng/dependencies.html#Dependency_Tree[Dependency Tree]
for the exact list of JAR files needed.

|log4j-iostreams[[log4j-iostreams]]
|The Log4j link:log4j-iostreams/index.html[IO Streams] module has no
external dependencies. This only requires the Log4j API.

|log4j-jcl[[log4j-jcl]]
|The link:log4j-jcl/index.html[Commons Logging Bridge] requires
http://commons.apache.org/proper/commons-logging/[Commons Logging]. See
the link:log4j-jcl/dependencies.html#Dependency_Tree[Dependency Tree]
for the exact list of JAR files needed.

|log4j-jmx-gui[[log4j-jmx-gui]]
|The Log4j link:log4j-jmx-gui/index.html[JMX GUI] requires the JConsole
jar when run as a JConsole plugin. Otherwise it has no external
dependencies. See the
link:log4j-jmx-gui/dependencies.html#Dependency_Tree[Dependency Tree]
for the exact list of JAR files needed.

|log4j-jul[[log4j-jul]]
|The Log4j 2 link:log4j-jul/index.html[Java Util Logging Adapter] has no
external dependencies. It optionally depends on the
link:log4j-api/index.html[Log4j Core] library. The only required module
is the Log4j API.

|log4j-mongodb4[[log4j-mongodb4]]
|The Log4j link:log4j-mongodb4/index.html[MongoDB] module depends on the
http://docs.mongodb.org/ecosystem/drivers/java/[MongoDB Java Client
driver].

|log4j-slf4j-impl[[log4j-slf4j-impl]]
|The Log4j 2 link:log4j-slf4j-impl/index.html[SLF4J Binding] depends on
the http://www.slf4j.org/[SLF4J] API. See the
link:log4j-slf4j-impl/dependencies.html#Dependency_Tree[Dependency Tree]
for the exact list of JAR files needed.

WARNING: Do not use this with the link:#log4j-to-slf4j[log4j-to-slf4j] module.

|log4j-spring-cloud-config-client[[log4j-spring-cloud-config-client]]
|link:log4j-spring-cloud-config-client.html[Log4j Spring Cloud Config Client] requires
https://spring.io/projects/spring-cloud-config[Spring Cloud Config].
https://spring.io/projects/spring-cloud-bus[Spring Cloud Bus] is required if notification of logging
configuration changes is desired. https://spring.io/projects/spring-boot[Spring Boot] is required
but applications do not have to be packaged as a Spring Boot application.

|log4j-to-slf4j[[log4j-to-slf4j]]
|The link:log4j-to-slf4j/index.html[Log4j 2 to SLF4J Adapter] requires
the http://www.slf4j.org/[SLF4J] API and an SLF4J implementation. See
the link:log4j-to-slf4j/dependencies.html#Dependency_Tree[Dependency
Tree] for the exact list of JAR files needed.

WARNING: Do not use this with the link:#log4j-slf4j-impl[log4j-slf4j-impl] module.

|===
