This is an automated email from the ASF dual-hosted git repository. pkarwasz pushed a commit to branch doc/2.x/configuration in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit f6c630885dce21ca35fe868dd46c3578da182cf4 Author: Piotr P. Karwasz <[email protected]> AuthorDate: Fri May 10 23:36:29 2024 +0200 Revamp configuration page --- .../ROOT/examples/configuration/filters.json | 37 + .../ROOT/examples/configuration/filters.properties | 23 + .../ROOT/examples/configuration/filters.xml | 24 + .../ROOT/examples/configuration/filters.yaml | 26 + .../examples/configuration/logger-properties.json | 29 + .../configuration/logger-properties.properties | 15 + .../examples/configuration/logger-properties.xml | 19 + .../examples/configuration/logger-properties.yaml | 18 + .../ROOT/examples/configuration/main-elements.json | 48 + .../configuration/main-elements.properties | 25 + .../ROOT/examples/configuration/main-elements.xml | 25 + .../ROOT/examples/configuration/main-elements.yaml | 27 + .../ROOT/examples/configuration/properties.json | 17 + .../examples/configuration/properties.properties | 3 + .../ROOT/examples/configuration/properties.xml | 12 + .../ROOT/examples/configuration/properties.yaml | 8 + .../ROOT/examples/configuration/routing.json | 34 + .../ROOT/examples/configuration/routing.properties | 20 + .../ROOT/examples/configuration/routing.xml | 27 + .../ROOT/examples/configuration/routing.yaml | 20 + .../modules/ROOT/pages/manual/appenders.adoc | 4 +- .../modules/ROOT/pages/manual/architecture.adoc | 1 + .../modules/ROOT/pages/manual/configuration.adoc | 534 ++++++++--- .../properties.adoc} | 0 .../ROOT/pages/manual/configuration_old.adoc | 1004 -------------------- .../antora/modules/ROOT/pages/manual/filters.adoc | 89 +- .../antora/modules/ROOT/pages/manual/lookups.adoc | 8 +- .../modules/ROOT/pages/plugin-reference.adoc | 765 +++++++++++++++ .../partials/properties-configuration-factory.adoc | 2 + .../partials/properties-transport-security.adoc | 2 +- 30 files changed, 1716 insertions(+), 1150 deletions(-) diff --git a/src/site/antora/modules/ROOT/examples/configuration/filters.json b/src/site/antora/modules/ROOT/examples/configuration/filters.json new file mode 100644 index 0000000000..62401f52d7 --- /dev/null +++ b/src/site/antora/modules/ROOT/examples/configuration/filters.json @@ -0,0 +1,37 @@ +{ + "Configuration": { + "Appenders": { + "Console": { + "name": "CONSOLE", + "ThresholdFilter": { + "level": "WARN" // <6> + } + } + }, + "Loggers": { + "Root": { + "level": "INFO", + "ThresholdFilter": { // <3> + "level": "DEBUG" + }, + "AppenderRef": { + "ref": "CONSOLE", + "level": "WARN", // <5> + "MarkerFilter": { // <4> + "marker": "ALERT", + "onMatch": "NEUTRAL", + "onMismatch": "DENY" + } + } + }, + "Logger": { + "name": "org.example", + "level": "TRACE" // <2> + } + } + }, + "MarkerFilter": { // <1> + "marker": "PRIVATE", + "onMismatch": "NEUTRAL" + } +} \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/examples/configuration/filters.properties b/src/site/antora/modules/ROOT/examples/configuration/filters.properties new file mode 100644 index 0000000000..8f0dd88e9d --- /dev/null +++ b/src/site/antora/modules/ROOT/examples/configuration/filters.properties @@ -0,0 +1,23 @@ +appender.0.type = Console +appender.0.name = CONSOLE +appender.0.filter.type = ThresholdFilter # <6> +appender.0.filter.level = WARN + +rootLogger.level = INFO +rootLogger.filter.type = ThresholdFilter # <3> +rootLogger.filter.level = DEBUG +rootLogger.appenderRef.0.ref = CONSOLE +rootLogger.appenderRef.0.level = WARN # <5> +rootLogger.appenderRef.0.filter.type = MarkerFilter # <4> +rootLogger.appenderRef.0.filter.marker = ALERT +rootLogger.appenderRef.0.filter.onMatch = NEUTRAL +rootLogger.appenderRef.0.filter.onMismatch = DENY + +logger.0.name = org.example +logger.0.level = DEBUG # <2> +logger.0.filter.type = ThresholdFilter # <3> +logger.0.filter.level = TRACE + +filter.type = MarkerFilter # <1> +filter.marker = PRIVATE +filter.onMismatch = NEUTRAL diff --git a/src/site/antora/modules/ROOT/examples/configuration/filters.xml b/src/site/antora/modules/ROOT/examples/configuration/filters.xml new file mode 100644 index 0000000000..4a8cb288b3 --- /dev/null +++ b/src/site/antora/modules/ROOT/examples/configuration/filters.xml @@ -0,0 +1,24 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Configuration xmlns="https://logging.apache.org/xml/ns" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-config-2.xsd"> + <Appenders> + <Console name="CONSOLE"> + <ThresholdFilter level="WARN"/> <!--6--> + </Console> + </Appenders> + <Loggers> + <Root level="INFO"> + <ThresholdFilter level="DEBUG"/> <!--3--> + <AppenderRef ref="CONSOLE" level="WARN"> <!--5--> + <MarkerFilter marker="ALERT" + onMatch="NEUTRAL" + onMismatch="DENY"/> <!--4--> + </AppenderRef> + </Root> + <Logger name="org.example" level="TRACE"> <!--2--> + <ThresholdFilter level="TRACE"/> <!--3--> + </Logger> + </Loggers> + <MarkerFilter marker="PRIVATE" onMismatch="NEUTRAL"/> <!--1--> +</Configuration> \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/examples/configuration/filters.yaml b/src/site/antora/modules/ROOT/examples/configuration/filters.yaml new file mode 100644 index 0000000000..738166b9a2 --- /dev/null +++ b/src/site/antora/modules/ROOT/examples/configuration/filters.yaml @@ -0,0 +1,26 @@ +Configuration: + Appenders: + Console: + name: "CONSOLE" + ThresholdFilter: # <6> + level: "WARN" + Loggers: + Root: + level: "INFO" + ThreadsholdFilter: # <3> + level: "DEBUG" + AppenderRef: + ref: "CONSOLE" + level: "WARN" # <5> + MarkerFilter: # <4> + marker: "ALERT" + onMatch: "NEUTRAL" + onMismatch: "DENY" + Logger: + name: "org.example" + level: "TRACE" # <2> + ThresholdFilter: + level: "TRACE" # <3> + MarkerFilter: # <1> + marker: "PRIVATE" + onMismatch: "NEUTRAL" \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/examples/configuration/logger-properties.json b/src/site/antora/modules/ROOT/examples/configuration/logger-properties.json new file mode 100644 index 0000000000..725de4263b --- /dev/null +++ b/src/site/antora/modules/ROOT/examples/configuration/logger-properties.json @@ -0,0 +1,29 @@ +{ + "Configuration": { + "Appenders": {}, + "Loggers": { + // tag::loggers[] + "Root": { + "Property": { + "name": "client.address", + "value": "$${web:request.remoteAddress}" + } + }, + "Logger": [ + { + "name": "org.hibernate", + "Property": { + "subsystem": "Database" + } + }, + { + "name": "io.netty", + "Property": { + "subsystem": "Networking" + } + } + ] + // end::loggers[] + } + } +} \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/examples/configuration/logger-properties.properties b/src/site/antora/modules/ROOT/examples/configuration/logger-properties.properties new file mode 100644 index 0000000000..252408fb3f --- /dev/null +++ b/src/site/antora/modules/ROOT/examples/configuration/logger-properties.properties @@ -0,0 +1,15 @@ +# tag::loggers[] +rootLogger.property.type = Property +rootLogger.name = client.address +rootLogger.value = $${web:request.remoteAddress} + +logger.0.name = org.hibernate +logger.0.property.type = Property +logger.0.property.name = subsystem +logger.0.property.value = Database + +logger.1.name = io.netty +logger.1.property.type = Property +logger.1.property.name = subsystem +logger.1.property.value = Networking +# end::loggers[] diff --git a/src/site/antora/modules/ROOT/examples/configuration/logger-properties.xml b/src/site/antora/modules/ROOT/examples/configuration/logger-properties.xml new file mode 100644 index 0000000000..a48f4e4367 --- /dev/null +++ b/src/site/antora/modules/ROOT/examples/configuration/logger-properties.xml @@ -0,0 +1,19 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Configuration xmlns="https://logging.apache.org/xml/ns" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-config-2.xsd"> + <Appenders/> + <Loggers> + <!-- tag::loggers[] --> + <Root> + <Property name="client.address" value="$${web:request.remoteAddress}"/> + </Root> + <Logger name="org.hibernate"> + <Property name="subsystem" value="Database"/> + </Logger> + <Logger name="io.netty"> + <Property name="subsystem" value="Networking"/> + </Logger> + <!-- end::loggers[] --> + </Loggers> +</Configuration> \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/examples/configuration/logger-properties.yaml b/src/site/antora/modules/ROOT/examples/configuration/logger-properties.yaml new file mode 100644 index 0000000000..74a90caa88 --- /dev/null +++ b/src/site/antora/modules/ROOT/examples/configuration/logger-properties.yaml @@ -0,0 +1,18 @@ +Configuration: + Appenders: {} + Loggers: + # tag::loggers[] + Root: + Property: + name: "client.address" + value: "$${web:request.remoteAddress}" + Logger: + - name: "org.hibernate" + Property: + name: "subsystem" + value: "Database" + - name: "io.netty" + Property: + name: "subsystem" + value: "Networking" + # end::loggers[] diff --git a/src/site/antora/modules/ROOT/examples/configuration/main-elements.json b/src/site/antora/modules/ROOT/examples/configuration/main-elements.json new file mode 100644 index 0000000000..1ab763c201 --- /dev/null +++ b/src/site/antora/modules/ROOT/examples/configuration/main-elements.json @@ -0,0 +1,48 @@ +{ + "Configuration": { + "Appenders": { + "Console": { // <1> + "name": "CONSOLE", + "target": "SYSTEM_OUT", + "PatternLayout": { + "pattern": "%p - %m%n" + } + }, + "File": [ + { // <2> + "name": "MAIN", + "fileName": "logs/main.log", + "JsonTemplateLayout": {} + }, + { // <3> + "name": "DEBUG_LOG", + "fileName": "logs/debug.log", + "PatternLayout": { + "pattern": "%d [%t] %p %c - %m%n" + } + } + ] + }, + "Loggers": { + "Root": { // <4> + "level": "INFO", + "AppenderRef": [ + { + "ref": "CONSOLE", + "level": "WARN" + }, + { + "ref": "MAIN" + } + ] + }, + "Logger": { // <5> + "name": "org.example", + "level": "DEBUG", + "AppenderRef": { + "ref": "DEBUG_LOG" + } + } + } + } +} \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/examples/configuration/main-elements.properties b/src/site/antora/modules/ROOT/examples/configuration/main-elements.properties new file mode 100644 index 0000000000..18e74222ea --- /dev/null +++ b/src/site/antora/modules/ROOT/examples/configuration/main-elements.properties @@ -0,0 +1,25 @@ +appender.0.type = Console # <1> +appender.0.name = CONSOLE +appender.0.target = SYSTEM_OUT +appender.0.layout.type = PatternLayout +appender.0.layout.pattern = %p - %m%n + +appender.1.type = File # <2> +appender.1.name = MAIN +appender.1.fileName = logs/main.log +appender.1.layout.type = JsonTemplateLayout + +appender.2.type = File # <3> +appender.2.name = DEBUG_LOG +appender.2.fileName = logs/debug.log +appender.2.layout.type = PatternLayout +appender.2.layout.pattern = %d [%t] %p %c - %m%n + +rootLogger.level = INFO # <4> +rootLogger.appenderRef.0.ref = CONSOLE +rootLogger.appenderRef.0.level = WARN +rootLogger.appenderRef.1.ref = MAIN + +logger.0.name = org.example # <5> +logger.0.level = DEBUG +logger.0.appenderRef.0.ref = DEBUG_LOG \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/examples/configuration/main-elements.xml b/src/site/antora/modules/ROOT/examples/configuration/main-elements.xml new file mode 100644 index 0000000000..3b911efb69 --- /dev/null +++ b/src/site/antora/modules/ROOT/examples/configuration/main-elements.xml @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Configuration xmlns="https://logging.apache.org/xml/ns" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-config-2.xsd"> + <Appenders> + <Console name="CONSOLE" target="SYSTEM_OUT"> <!--1--> + <PatternLayout pattern="%p - %m%n"/> + </Console> + <File name="MAIN" fileName="logs/main.log"> <!--2--> + <JsonTemplateLayout/> + </File> + <File name="DEBUG_LOG" fileName="logs/debug.log"> <!--3--> + <PatternLayout pattern="%d [%t] %p %c - %m%n"/> + </File> + </Appenders> + <Loggers> + <Root level="INFO"> <!--4--> + <AppenderRef ref="CONSOLE" level="WARN"/> + <AppenderRef ref="MAIN"/> + </Root> + <Logger name="org.example" level="DEBUG"> <!--5--> + <AppenderRef ref="DEBUG_LOG"/> + </Logger> + </Loggers> +</Configuration> \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/examples/configuration/main-elements.yaml b/src/site/antora/modules/ROOT/examples/configuration/main-elements.yaml new file mode 100644 index 0000000000..65855bf4ca --- /dev/null +++ b/src/site/antora/modules/ROOT/examples/configuration/main-elements.yaml @@ -0,0 +1,27 @@ +Configuration: + Appenders: + Console: # <1> + name: "CONSOLE" + target: "SYSTEM_OUT" + PatternLayout: + pattern: "%p - %m%n" + File: + - name: "MAIN" # <2> + fileName: "logs/main.log" + JsonTemplateLayout: { } + - name: "DEBUG_LOG" # <3> + fileName: "logs/debug.log" + PatternLayout: + pattern: "%d [%t] %p %c - %m%n" + Loggers: + Root: # <4> + level: "INFO" + AppenderRef: + - ref: "CONSOLE" + level: "WARN" + - ref: "MAIN" + Logger: # <5> + name: "org.example" + level: "DEBUG" + AppenderRef: + ref: "DEBUG_LOG" \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/examples/configuration/properties.json b/src/site/antora/modules/ROOT/examples/configuration/properties.json new file mode 100644 index 0000000000..c3fb1911b2 --- /dev/null +++ b/src/site/antora/modules/ROOT/examples/configuration/properties.json @@ -0,0 +1,17 @@ +{ + "Configuration": { + "Properties": { + "Property": [ + { + "name": "log.dir", + "value": "/var/log" + }, + { + "name": "log.file", + "value": "${log.dir}/app.log" + } + ] + } + // ... + } +} \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/examples/configuration/properties.properties b/src/site/antora/modules/ROOT/examples/configuration/properties.properties new file mode 100644 index 0000000000..47d6bd93b1 --- /dev/null +++ b/src/site/antora/modules/ROOT/examples/configuration/properties.properties @@ -0,0 +1,3 @@ +property.log.dir = /var/log +property.log.file = ${log.dir}/app.log +# ... \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/examples/configuration/properties.xml b/src/site/antora/modules/ROOT/examples/configuration/properties.xml new file mode 100644 index 0000000000..01852b2166 --- /dev/null +++ b/src/site/antora/modules/ROOT/examples/configuration/properties.xml @@ -0,0 +1,12 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Configuration xmlns="https://logging.apache.org/xml/ns" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-config-2.xsd"> + <Properties> + <Property name="log.dir" value="/var/log"/> + <Property name="log.file" value="${log.dir}/app.log"/> + </Properties> + <!-- tag::empty[] --> + <Appenders/> + <!-- end::empty[] --> +</Configuration> \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/examples/configuration/properties.yaml b/src/site/antora/modules/ROOT/examples/configuration/properties.yaml new file mode 100644 index 0000000000..519d6e4ee0 --- /dev/null +++ b/src/site/antora/modules/ROOT/examples/configuration/properties.yaml @@ -0,0 +1,8 @@ +Configuration: + Properties: + Property: + - name: "log.dir" + value: "/var/log" + - name: "log.file" + value: "${log.dir}/app.log" +# ... \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/examples/configuration/routing.json b/src/site/antora/modules/ROOT/examples/configuration/routing.json new file mode 100644 index 0000000000..cc6ab3b5e6 --- /dev/null +++ b/src/site/antora/modules/ROOT/examples/configuration/routing.json @@ -0,0 +1,34 @@ +{ + "Configuration": { + "Appenders": { + // tag::appender[] + "Routing": { + "name": "ROUTING", + "Routes": { + "pattern": "$${sd:type}", // <1> + "Route": { + "File": { + "name": "ROUTING-${sd:type}", // <2> + "fileName": "logs/${sd:type}.log", // <2> + "JsonTemplateLayout": { + "EventTemplateAdditionalField": { + "name": "type", + "value": "${sd:type}" // <2> + } + } + } + } + } + } + // end::appender[] + }, + "Loggers": { + "Root": { + "AppenderRef": { + "level": "INFO", + "ref": "ROUTING" + } + } + } + } +} diff --git a/src/site/antora/modules/ROOT/examples/configuration/routing.properties b/src/site/antora/modules/ROOT/examples/configuration/routing.properties new file mode 100644 index 0000000000..e860c5e9da --- /dev/null +++ b/src/site/antora/modules/ROOT/examples/configuration/routing.properties @@ -0,0 +1,20 @@ +# tag::appender[] +appender.0.type = Routing +appender.0.name = ROUTING + +appender.0.routes.type = Routes +appender.0.routes.pattern = $${sd:type} # <1> + +appender.0.routes.route.type = Route + +appender.0.routes.route.file.type = File +appender.0.routes.route.file.name = ROUTING-${sd:type} # <2> +appender.0.routes.route.file.fileName = logs/${sd:type}.log # <2> +appender.0.routes.route.file.layout.type = JsonTemplateLayout +appender.0.routes.route.file.layout.field.type = EventTemplateAdditionalField +appender.0.routes.route.file.layout.field.name = type +appender.0.routes.route.file.layout.field.value = ${sd:type} # <2> +# end::appender[] + +rootLogger.level = INFO +rootLogger.appenderRef.0.ref = ROUTING diff --git a/src/site/antora/modules/ROOT/examples/configuration/routing.xml b/src/site/antora/modules/ROOT/examples/configuration/routing.xml new file mode 100644 index 0000000000..65e7b5df55 --- /dev/null +++ b/src/site/antora/modules/ROOT/examples/configuration/routing.xml @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8"?> +<Configuration xmlns="https://logging.apache.org/xml/ns" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="https://logging.apache.org/xml/ns https://logging.apache.org/xml/ns/log4j-config-2.xsd"> + <Appenders> + <!-- tag::appender[] --> + <Routing name="ROUTING"> + <Routes pattern="$${sd:type}"> <!--1--> + <Route> + <File name="ROUTING-${sd:type}" + fileName="logs/${sd:type}.log"> <!--2--> + <JsonTemplateLayout> + <EventTemplateAdditionalField name="type" + value="${sd:type}"/> <!--2--> + </JsonTemplateLayout> + </File> + </Route> + </Routes> + </Routing> + <!-- end::appender[] --> + </Appenders> + <Loggers> + <Root level="INFO"> + <AppenderRef ref="ROUTING"/> + </Root> + </Loggers> +</Configuration> \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/examples/configuration/routing.yaml b/src/site/antora/modules/ROOT/examples/configuration/routing.yaml new file mode 100644 index 0000000000..767247939a --- /dev/null +++ b/src/site/antora/modules/ROOT/examples/configuration/routing.yaml @@ -0,0 +1,20 @@ +Configuration: + Appenders: + # tag::appender[] + Routing: + name: "ROUTING" + Routes: + pattern: "$${sd:type}" # <1> + Route: + File: + name: "ROUTING-${sd:type}" # <2> + fileName: "logs/${sd:type}.log" # <2> + JsonTemplateLayout: + EventTemplateAdditionalField: + name: "type" + value: "${sd:type}" # <2> + # end::appender[] + Loggers: + Root: + level: "INFO" + AppenderRef: "ROUTING" diff --git a/src/site/antora/modules/ROOT/pages/manual/appenders.adoc b/src/site/antora/modules/ROOT/pages/manual/appenders.adoc index 72b579961c..95e7c6fea8 100644 --- a/src/site/antora/modules/ROOT/pages/manual/appenders.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/appenders.adoc @@ -2445,8 +2445,8 @@ with `com.foo.bar`. </Configuration> ---- -[#RollingFileAppender] -== RollingFileAppender +[id=rollingfileappender] +== [[RollingFileAppender]] RollingFileAppender The RollingFileAppender is an OutputStreamAppender that writes to the File named in the fileName parameter and rolls the file over according diff --git a/src/site/antora/modules/ROOT/pages/manual/architecture.adoc b/src/site/antora/modules/ROOT/pages/manual/architecture.adoc index 02b4d24c97..8cdaf8aab3 100644 --- a/src/site/antora/modules/ROOT/pages/manual/architecture.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/architecture.adoc @@ -32,6 +32,7 @@ the root LoggerConfig. LoggerConfig objects are created from Logger declarations in the configuration. The LoggerConfig is associated with the Appenders that actually deliver the LogEvents. +[id=logger-hierarchy] === Logger Hierarchy The first and foremost advantage of any logging API over plain diff --git a/src/site/antora/modules/ROOT/pages/manual/configuration.adoc b/src/site/antora/modules/ROOT/pages/manual/configuration.adoc index e8fc3615de..770694bd8b 100644 --- a/src/site/antora/modules/ROOT/pages/manual/configuration.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/configuration.adoc @@ -64,6 +64,16 @@ Upon initialization of a new logger context, Log4j assigns it a context name and . If no configuration file could be located a link:../javadoc/log4j-core/org/apache/logging/log4j/core/config/DefaultConfiguration[DefaultConfiguration] is used and a warning is printed by the status logger. The default configuration prints all messages less specific than <<log4j2.level>> to the console. +[CAUTION] +==== +The configuration files prefixed by `log4j2-test` should only be used on the test classpath. + +If multiple configuration files in the same category are found, Log4j uses a deterministic order to choose one of them (cf. link:../javadoc/log4j-core/org/apache/logging/log4j/core/config/Order[@Order]). +Nevertheless, application developers are advised not to use multiple configuration files that differ only by the extension. + +Most libraries should not contain Log4j configuration files in their default location to allow applications to define their own. +==== + The `<contextName>` and `<extension>` placeholders above have the following meaning <contextName>:: depends on the runtime environment in which Log4j runs: @@ -238,7 +248,7 @@ In order to make it more usable a series of exceptions to the rules in <<configu . The following direct children of `Configuration` have predefined prefixes and do not require to specify a `type` attribute: * The xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-AppendersPlugin[Appender container] has a predefined `appender` prefix. -* The xref:plugin-reference.adoc##org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-CustomLevels[Custom levels container] has a predefined `customLevel` prefix. +* The xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-CustomLevels[Custom levels container] has a predefined `customLevel` prefix. * The xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-LoggersPlugin[Loggers container] has a predefined `logger` prefix. * The xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-PropertiesPlugin[Properties container] has a predefined `property` prefix. * The xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-ScriptsPlugin[Scripts container] has a predefined `script` prefix. @@ -291,150 +301,440 @@ XML:: + [source,xml] ---- -<?xml version="1.0" encoding="UTF-8"?> -<Configuration xmlns="https://logging.apache.org/xml/ns"> - <Appenders> - <Console name="CONSOLE" target="SYSTEM_OUT"> - <PatternLayout pattern="%p - %m%n"/> - </Console> - <File name="AUDIT" fileName="logs/audit.log"> - <JsonTemplateLayout/> - </File> - <File name="MAIN" fileName="logs/main.log"> - <PatternLayout pattern="%d [%t] %p %c - %m%n"/> - </File> - </Appenders> - <Loggers> - <Root level="WARN"> - <AppenderRef ref="CONSOLE"/> - <AppenderRef ref="MAIN"/> - </Root> - <Logger name="org.example.audit" level="INFO"> - <AppenderRef ref="AUDIT"/> - </Logger> - </Loggers> -</Configuration> +include::example$configuration/main-elements.xml[] ---- JSON:: + [source,json] ---- -{ - "Configuration": { - "Appenders": { - "Console": { - "name": "CONSOLE", - "target": "SYSTEM_OUT", - "PatternLayout": { - "pattern": "%p - %m%n" - } - }, - "File": [ - { - "name": "AUDIT", - "fileName": "logs/audit.log", - "JsonTemplateLayout": {} - }, - { - "name": "MAIN", - "fileName": "logs/main.log", - "PatternLayout": { - "pattern": "%d [%t] %p %c - %m%n" - } - } - ] - }, - "Loggers": { - "Root": { - "level": "WARN", - "AppenderRef": [ - { - "ref": "CONSOLE" - }, - { - "ref": "MAIN" - } - ] - }, - "Logger": { - "name": "org.example.audit", - "level": "INFO", - "AppenderRef": { - "ref": "AUDIT" - } - } - } - } -} +include::example$configuration/main-elements.json[] ---- YAML:: + [source,yaml] ---- -Configuration: - Appenders: - Console: - - name: "CONSOLE" - target: "SYSTEM_OUT" - PatternLayout: - pattern: "%p - %m%n" - File: - - name: "AUDIT" - fileName: "logs/audit.log" - JsonTemplateLayout: { } - - name: "MAIN" - fileName: "logs/main.log" - PatternLayout: - pattern: "%d [%t] %p %c - %m%n" - Loggers: - Root: - level: "WARN" - AppenderRef: - - ref: "CONSOLE" - - ref: "MAIN" - Logger: - name: "org.example.audit" - level: "INFO" - AppenderRef: - ref: "AUDIT" +include::example$configuration/main-elements.yaml[] ---- Java properties:: + [source,properties] ---- -appender.0.type = Console -appender.0.name = CONSOLE -appender.0.target = SYSTEM_OUT -appender.0.layout.type = PatternLayout -appender.0.layout.pattern = %p - %m%n +include::example$configuration/main-elements.properties[] +---- +==== + +<1> Configures a console appender named `CONSOLE` with a pattern layout. +<2> Configures a file appender named `MAIN` with a JSON template layout. +<3> Configures a file appender named `DEBUG_LOG` with a pattern layout. +<4> Configures the root logger at level `INFO` and connects it to the `CONSOLE` and `MAIN` appenders. +The `CONSOLE` appender will only log messages less specific than `WARN`. +<5> Configures a logger named `"org.example"` at level `DEBUG` and connects it to the `DEBUG_LOG` appender. +The logger is configured to forward messages to its parent (the root appender). + +[cols="2m,2m,5"] +|=== +| Logger name | Log event level | Appenders + +| org.example.foo +| WARN +| `CONSOLE`, `MAIN`, `DEBUG_LOG` + +| org.example.foo +| DEBUG +| `MAIN`, `DEBUG_LOG` + +| org.example.foo +| TRACE +| _none_ + +| com.example +| WARN +| `CONSOLE`, `MAIN` + +| com.example +| INFO +| `MAIN` + +| com.example +| DEBUG +| _none_ + +|=== + +=== Global configuration attributes + +The main `Configuration` element has a set of attributes that can be used to tune the way the configuration file itself is used. +The principal attributes are listed below. +See xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-Configuration[Plugin reference] for a complete list. + +[id=configuration-attribute-monitorInterval] +==== `monitorInterval` + +[cols="1h,5"] +|=== +| Type | `int` +| Default value | `0` +|=== + +Determines the polling interval used by Log4j to check for changes to the configuration file. + +If set to `0`, polling is disabled. + +[NOTE] +==== +Unlike other logging backends Log4j Core is designed with audit logging in mind. + +During a reconfiguration process, no messages are lost. +Unless the new configuration file removes an appender, the old one continues to work without interruption. +==== + +[id=configuration-attribute-status] +==== `status` + +[cols="1h,5"] +|=== +| Type | link:../javadoc/log4j-api/org/apache/logging/log4j/Level.html[LEVEL] +| Status | **DEPRECATED** +| Default value (since 2.24.0) | <<log4j2.statusLoggerLevel>> +| Default value (before 2.24.0) | value of `log4j2.defaultStatusLevel` +|=== + +Overrides the logging level of the status logger. + +WARNING: Since 2.24.0 this attribute is deprecated and should be replaced with the <<log4j2.statusLoggerLevel>> +variable. + +[id=configuration-attribute-schema] +==== `schema` + +[cols="1h,5"] +|=== +| Type | classpath resource +| Default value | `null` +|=== + +[id=configuration-attribute-strict] +==== `strict` + +[cols="1h,5"] +|=== +| Type | `boolean` +| Default value | `false` +|=== + +If set to `true` all configuration files will be checked against. + +[id=configuration-elements-filters] +==== Filters + +See xref:manual/filters.adoc#filters[Filters] for additional filtering capabilities that can be applied to the global configuration object. + +=== Logger configuration + +Log4j 2 contains multiple types of logger components that can be added to the `Loggers` element of the configuration: -appender.1.type = File -appender.1.name = AUDIT -appender.1.fileName = logs/audit.log -appender.1.layout.type = JsonTemplateLayout +`Root`:: is the logger that receives all events that do not have a more specific logger defined. ++ +See also xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-LoggerConfig-RootLogger[Plugin reference]. + +`AsyncRoot`:: is an alternative implementation of the root logger used in the xref:manual/async.adoc#MixedSync-Async[mixed synchronous and asynchronous mode]. ++ +See also xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-async-AsyncLoggerConfig-RootLogger[Plugin reference]. + +`Logger`:: the most common logger kind, which collects log events from itself and all its children loggers, which do not have an explicit configuration (see xref:manual/architecture.adoc#logger-hierarchy[logger hierarchy]). ++ +See also xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-LoggerConfig[Plugin Reference]. + +`AsyncLogger`:: the equivalent of `Logger`, used in the xref:manual/async.adoc#MixedSync-Async[mixed synchronous and asynchronous mode]. ++ +See also xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-async-AsyncLoggerConfig[Plugin Reference]. + +Every configuration **must** have at least a `Root` or `AsyncRoot` element. +The presence of other logger configurations is optional. + +The logger components can have the following attributes and elements: + +[id=logger-attributes-name] +==== `name` + +[cols="1h,5"] +|=== +| Type | `String` +| Applies to | `Logger` and `AsyncLogger` +|=== + +Specifies the name of the logger configuration. + +Since loggers are usually named using fully qualified class names, this value usually contains the fully qualified name of a class or a package. + +[id=logger-attributes-additivity] +==== `additivity` + +[cols="1h,5"] +|=== +| Type | `boolean` +| Default value | `true` +| Applies to | `Logger` and `AsyncLogger` +|=== + +If `true` (default), all the messages received by this logger will also be transmitted to its parent logger. + +[id=logger-attributes-level] +==== `level` + +[cols="1h,5"] +|=== +| Type | link:../javadoc/log4j-api/org/apache/logging/log4j/Level.html[Level] +| Default value +a| +* <<log4j2.level>>, for `Root` and `AsyncRoot`, +* inherited from the parent logger, for `Logger` and `AsyncLogger`. +|=== + +Specifies the level threshold that a log event must have to be logged. +Log events more specific than this setting will be filtered out. + +See also xref:manual/filters.adoc#filters[Filters] if you require additional filtering. + +[id=logger-attributes-includeLocation] +==== `includeLocation` -appender.2.type = File -appender.2.name = MAIN -appender.2.fileName = logs/main.log -appender.2.layout.type = PatternLayout -appender.2.layout.pattern = %d [%t] %p %c - %m%n +[cols="1h,5"] +|=== +| Type | `boolean` +| Default value +a| +* `false`, if an asynchrounous `ContextSelector` is used. +* Otherwise, +** `true` for `Root` and `Logger`, +** `false` for `AsyncRoot` and `AsyncLogger`. + +See <<log4j2.contextSelector>> for more details. +|=== + +Specifies whether Log4j is allowed to compute location information. + +Computing the location information of a logging statement is an expensive operation (a couple of microseconds). +While Log4j makes every effort to only compute it if it was requested by a configured layout (cf. xref:manual/layouts.adoc[Layouts]), this setting provide a kill switch to disable it. + +[TIP] +==== +This setting only applies to computation of location at **runtime**. -rootLogger.level = WARN -rootLogger.appenderRef.0.ref = CONSOLE -rootLogger.appenderRef.1.ref = MAIN +If the location is computed at build time using link:/log4j/transform/latest/#log4j-transform-maven-plugin[Log4j Transform Maven Plugin] this setting is ignored and location information will always be available for logging. +==== + +[id=logger-elements-properties] +==== Additional context properties -logger.0.name = org.example.audit -logger.0.level = INFO -logger.0.appenderRef.0.ref = AUDIT +Loggers can emit additional context data that will be integrated with other context data sources such as xref:manual/thread-context.adoc[ThreadContext]. + +[CAUTION] +==== +The `value` of each property is subject to <<property-substitution,property substitution>> twice: + +* when the configuration is loaded, +* each time a log event is generated. + +Therefore, if you wish to insert a value that changes in time you must double the `$` sign as in the example below. +==== + +[tabs] +==== +XML:: ++ +[source,xml] +---- +include::example$configuration/logger-properties.xml[tag=loggers] +---- + +JSON:: ++ +[source,json] +---- +include::example$configuration/logger-properties.json[tag=loggers] +---- + +YAML:: ++ +[source,yaml] +---- +include::example$configuration/logger-properties.yaml[tag=loggers] +---- + +Java properties:: ++ +[source,properties] +---- +include::example$configuration/logger-properties.properties[tag=loggers] ---- ==== +[id=logger-elements-filters] +==== Filters + +See xref:manual/filters.adoc#filters[Filters] for additional filtering capabilities that can be applied to a logger configuration. + [id=property-substitution] === Property substitution +Log4j provides a simple and extensible mechanism to reuse values in the configuration file using `$\{name}` expressions, such as those used in Bash, Ant or Maven. + +Reusable configuration values can be added directly to a configuration file by using a xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-PropertiesPlugin[Properties] component. + +[tabs] +==== +XML:: ++ +[source,xml] +---- +include::example$configuration/properties.xml[tag=!empty] +---- + +JSON:: ++ +[source,json] +---- +include::example$configuration/properties.json[] +---- + +YAML:: ++ +[source,yaml] +---- +include::example$configuration/properties.yaml[] +---- + +Java properties:: ++ +[source,properties] +---- +include::example$configuration/properties.properties[] +---- +==== + +Reusable configuration values can be also provided by an extensible lookup mechanism. +See xref:manual/lookups.adoc[Lookup]s for more information. + +Configuration values defined this way can be used in **any** configuration attribute by using the following expansion rules: + +`$\{name}`:: ++ +If the `Properties` element of the configuration file has a property named `name` its value is substituted. +Otherwise, the placeholder is not expanded. ++ +[WARNING] +==== +If `name` contains a `:` character, it is expanded as in the rule below. +==== + +`${lookup:name}`:: +If both these considitions hold: ++ +-- +* `lookup` is a prefix assigned to a xref:manual/lookups.adoc[Lookup], +* the lookup has a value assigned to `name`, +-- ++ +the value for the lookup is a substituted. +Otherwise, the expansion of `$\{name}` is substituted. ++ +If `name` starts with a hyphen `-` (e.g. `-variable`), it must be escaped with a backslash `\` (e.g. `\-variable`). ++ +The most common lookup prefixes are: ++ +* `sys` for Java system properties (see xref:manual/lookups.adoc#system-properties-lookup[System Properties lookup]), +* `env` for environment variables (see xref:manual/lookups.adoc#environment-lookup[Environment lookup]). + +The above expansions have a version with an additional `default` value that is **expanded** if the lookup fails: + +`${name:-default}`:: ++ +If the `Properties` element of the configuration file has a property named `name` its value is substituted. +Otherwise, the **expansion** of `default` is substituted. ++ +[WARNING] +==== +If `name` contains a `:` character, it is expanded as in the rule below. +==== + +`${lookup:name:-default}`:: ++ +If both these considitions hold: ++ +-- +* `lookup` is a prefix assigned to a xref:manual/lookups.adoc[Lookup], +* the lookup has a value assigned to `name`, +-- ++ +the value for the lookup is a substituted. +Otherwise, the expansion of `$\{name:-default}` is substituted. + +[NOTE] +==== +To prevent the expansion of one of the expression above, the initial `$` must be doubled as `$$`. + +The same rule applies to the `name` parameter: if it contains a `${` sequence, the sequence must be escaped as `$${`. +==== + +[id=lazy-property-substitution] +==== Lazy property substitution + +While property substitution is performed once at **configuration time** for most attributes, there are two exceptions to this rule: + +* Some attributes are **also** evaluated when a component specific event occurs. +For example +<<logger-elements-properties,additional context properties>> +and the `pattern` attribute of the example below are evaluated at each log event, while the `filePattern` attribute of a +xref:manual/appenders.adoc#rollingfileappender[rolling file appender] +is evaluated at each rollover. ++ +In this case: + +** If you want property substitution to happen only once, you use one dollar sign, e.g. `${date:HH:mm:ss}`. +** If you want property substitution to happen at each cyclic event, you use two dollar signs, e.g. `$${date:HH:mm:ss}` + +* Other components defer the evaluation of their children components. +In this case you only need one dollar `$` sign. ++ +This case happens for the children of the `Route` element below: + +[tabs] +==== +XML:: ++ +[source,xml] +---- +include::example$configuration/routing.xml[tag=appender] +---- + +JSON:: ++ +[source,json] +---- +include::example$configuration/routing.json[tag=appender] +---- + +YAML:: ++ +[source,yaml] +---- +include::example$configuration/routing.yaml[tag=appender] +---- + +Java properties:: ++ +[source,properties] +---- +include::example$configuration/routing.properties[tag=appender] +---- +==== +<1> The `pattern` attribute is evaluated at configuration time and also each time a log event is routed. Therefore, the dollar `$` sign needs to be escaped. +<2> All the attributes inside the `File` element have a **deferred** evaluation, therefore they need only one `$` sign. + [#log4j-core-programmatic-configuration] == Programmatic configuration diff --git a/src/site/antora/modules/ROOT/pages/manual/_properties.adoc b/src/site/antora/modules/ROOT/pages/manual/configuration/properties.adoc similarity index 100% rename from src/site/antora/modules/ROOT/pages/manual/_properties.adoc rename to src/site/antora/modules/ROOT/pages/manual/configuration/properties.adoc diff --git a/src/site/antora/modules/ROOT/pages/manual/configuration_old.adoc b/src/site/antora/modules/ROOT/pages/manual/configuration_old.adoc index 50403d926a..d34d313fcd 100644 --- a/src/site/antora/modules/ROOT/pages/manual/configuration_old.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/configuration_old.adoc @@ -204,28 +204,6 @@ trace will result in results similar to: Note that status logging is disabled when the default configuration is used. -[#Configuration_From_a_URI] -== Configuration From a URI - -When `log4j2.configurationFile` references a URL, Log4j will first determine if the URL reference -a file using the file protocol. If it does Log4j will validate that the file URL is valid and continue -processing as previously described. If it contains a protocol other than file then Log4j will inspect -the value of the <<log4j2.configurationAllowedProtocols>> system property. If the provided list -contains the protocol specified then Log4j will use the URI to locate the specified configuration file. If -not an exception will be thrown and an error message will be logged. If no value is provided for the -system property it will default to "https". Use of any protocol other than "file" can be prevented by -setting the system property value to "_none". This value would be an invalid protocol so cannot conflict -with any custom protocols that may be present. - -Log4j supports access to remote URLs that require authentication. Log4j supports basic authentication -out of the box. If the `log4j2.Configuration.username` and `log4j2.Configuration.password` -are specified those values will be used to perform the authentication. If the password is encrypted a custom -password decryptor may be supplied by specifying the fully qualified class name in the -<<log4j2.configurationPasswordDecryptor>> system property. A custom -`AuthenticationProvider` may be used by setting the -`<<log4j2.configurationAuthorizationProvider>> system property to the fully qualified class name -of the provider. - [#Additivity] == Additivity @@ -321,656 +299,6 @@ Once an event reaches a logger with its additivity set to false the event will not be passed to any of its parent loggers, regardless of their additivity setting. -[#AutomaticReconfiguration] -== Automatic Reconfiguration - -When configured from a File, Log4j has the ability to automatically -detect changes to the configuration file and reconfigure itself. If the -`monitorInterval` attribute is specified on the configuration element -and is set to a non-zero value then the file will be checked the next -time a log event is evaluated and/or logged and the monitorInterval has -elapsed since the last check. The example below shows how to configure -the attribute so that the configuration file will be checked for changes -only after at least 30 seconds have elapsed. The minimum interval is 5 -seconds. - -[source,xml] ----- -<?xml version="1.0" encoding="UTF-8"?> -<Configuration monitorInterval="30"> -... -</Configuration> ----- - -[#ChainsawSupport] -== Chainsaw can automatically process your log files (Advertising appender configurations) - -Log4j provides the ability to 'advertise' appender configuration details -for all file-based appenders as well as socket-based appenders. For -example, for file-based appenders, the file location and the pattern -layout in the file are included in the advertisement. Chainsaw and other -external systems can discover these advertisements and use that -information to intelligently process the log file. - -The mechanism by which an advertisement is exposed, as well as the -advertisement format, is specific to each Advertiser implementation. An -external system which would like to work with a specific Advertiser -implementation must understand how to locate the advertised -configuration as well as the format of the advertisement. For example, a -'database' Advertiser may store configuration details in a database -table. An external system can read that database table in order to -discover the file location and the file format. - -Log4j provides one Advertiser implementation, a 'multicastdns' -Advertiser, which advertises appender configuration details via IP -multicast using the http://jmdns.sourceforge.net library. - -Chainsaw automatically discovers log4j's multicastdns-generated -advertisements and displays those discovered advertisements in -Chainsaw's Zeroconf tab (if the jmdns library is in Chainsaw's -classpath). To begin parsing and tailing a log file provided in an -advertisement, just double-click the advertised entry in Chainsaw's -Zeroconf tab. Currently, Chainsaw only supports FileAppender -advertisements. - -To advertise an appender configuration: - -* Add the JmDns library from http://jmdns.sourceforge.net to the -application classpath -* Set the 'advertiser' attribute of the configuration element to -'multicastdns' -* Set the 'advertise' attribute on the appender element to 'true' -* If advertising a FileAppender-based configuration, set the -'advertiseURI' attribute on the appender element to an appropriate URI - -FileAppender-based configurations require an additional 'advertiseURI' -attribute to be specified on the appender. The 'advertiseURI' attribute -provides Chainsaw with information on how the file can be accessed. For -example, the file may be remotely accessible to Chainsaw via ssh/sftp by -specifying a Commons VFS (http://commons.apache.org/proper/commons-vfs/) -sftp:// URI, an http:// URI may be used if the file is accessible -through a web server, or a file:// URI can be specified if accessing the -file from a locally-running instance of Chainsaw. - -Here is an example advertisement-enabled appender configuration which -can be used by a locally-running Chainsaw to automatically tail the log -file (notice the file:// advertiseURI): - -*Please note, you must add the JmDNS library mentioned above.* - -[source,xml] ----- -<?xml version="1.0" encoding="UTF-8"?> -<Configuration advertiser="multicastdns"> - ... - <Appenders> - <File name="File1" fileName="output.log" bufferedIO="false" advertiseURI="file://path/to/output.log" advertise="true"> - ... - </File> - </Appenders> -</Configuration> ----- - -[#ConfigurationSyntax] -== Configuration Syntax - -As of version 2.9, for security reasons, Log4j does not process DTD in -XML files. If you want to split the configuration in multiple files, use -link:#XInclude[XInclude] or link:#CompositeConfiguration[Composite -Configuration]. - -As the previous examples have shown as well as those to follow, Log4j -allows you to easily redefine logging behavior without needing to modify -your application. It is possible to disable logging for certain parts of -the application, log only when specific criteria are met such as the -action being performed for a specific user, route output to Flume or a -log reporting system, etc. Being able to do this requires understanding -the syntax of the configuration files. - -The configuration element in the XML file accepts several attributes: - -[cols="1m,5a"] -|=== -|Attribute Name |Description - -|advertiser -|(Optional) The Advertiser plugin name which will be used to -advertise individual FileAppender or SocketAppender configurations. The -only Advertiser plugin provided is "multicastdns". - -|dest -|Either "err" for stderr, "out" for stdout, a file path, or a URL. - -|monitorInterval -|The minimum amount of time, in seconds, that must -elapse before the file configuration is checked for changes. - -|name -|The name of the configuration. - -|schema -|Identifies the location for the classloader to located the XML -Schema to use to validate the configuration. Only valid when strict is -set to true. If not set no schema validation will take place. - -|shutdownHook -|Specifies whether or not Log4j should automatically -shutdown when the JVM shuts down. The shutdown hook is enabled by -default but may be disabled by setting this attribute to "disable" - -|shutdownTimeout -|Specifies how many milliseconds appenders and -background tasks will get to shutdown when the JVM shuts down. Default -is zero which mean that each appender uses its default timeout, and -don't wait for background tasks. Not all appenders will honor this, it -is a hint and not an absolute guarantee that the shutdown procedure will -not take longer. Setting this too low increase the risk of losing -outstanding log events not yet written to the final destination. See -link:../javadoc/log4j-core/org/apache/logging/log4j/core/LoggerContext.html$%7Besc.hash%7Dstop(long,%20java.util.concurrent.TimeUnit)[LoggerContext.stop(long, -java.util.concurrent.TimeUnit)]. (Not used if `shutdownHook` is set to -"disable".) - -|status -|The level of internal Log4j events that should be logged to the console. -Valid values for this attribute are "off", "trace", "debug", "info", "warn", -"error", "fatal", and "all". Log4j will log details about initialization, -rollover and other internal actions to the status logger. Setting -`status="trace"` is one of the first tools available to you if you need -to troubleshoot log4j. - -(Alternatively, setting system property <<log4j2.debug>> will also print -internal Log4j2 logging to the console, including internal logging that -took place before the configuration file was found.) - -|strict -|Enables the use of the strict XML format. Not supported in JSON -configurations. - -|verbose -|Enables diagnostic information while loading plugins. -|=== - -[[XML]] -=== Configuration with XML - -Log4j can be configured using two XML flavors; concise and strict. - -=== Concise Syntax - -The concise format makes configuration very easy as the element names match -the components they represent however it cannot be validated with an XML -schema. For example, the ConsoleAppender is configured by declaring an -XML element named Console under its parent appenders element. However, -element and attribute names are not case sensitive. In addition, -attributes can either be specified as an XML attribute or as an XML -element that has no attributes and has a text value. So - -[source,xml] ----- -<PatternLayout pattern="%m%n"/> ----- - -and - -[source,xml] ----- -<PatternLayout> - <Pattern>%m%n</Pattern> -</PatternLayout> ----- - -are equivalent. - -The file below represents the structure of an XML configuration, but -note that the elements in italics below represent the concise element -names that would appear in their place. - -[source,xml] ----- -<?xml version="1.0" encoding="UTF-8"?>; -<Configuration> - <Properties> - <Property name="name1">value</property> - <Property name="name2" value="value2"/> - </Properties> - <filter ... /> - <Appenders> - <appender ... > - <filter ... /> - </appender> - ... - </Appenders> - <Loggers> - <Logger name="name1"> - <filter ... /> - </Logger> - ... - <Root level="level"> - <AppenderRef ref="name"/> - </Root> - </Loggers> -</Configuration> ----- - -See the many examples on this page for sample appender, filter and -logger declarations. - -=== Strict XML - -In addition to the concise XML format above, Log4j allows configurations -to be specified in a more "normal" XML manner that can be validated -using an XML Schema. This is accomplished by replacing the friendly -element names above with their object type as shown below. For example, -instead of the ConsoleAppender being configured using an element named -Console it is instead configured as an appender element with a type -attribute containing "Console". - -[source,xml] ----- -<?xml version="1.0" encoding="UTF-8"?> -<Configuration> - <Properties> - <Property name="name1">value</property> - <Property name="name2" value="value2"/> - </Properties> - <Filter type="type" ... /> - <Appenders> - <Appender type="type" name="name"> - <Filter type="type" ... /> - </Appender> - ... - </Appenders> - <Loggers> - <Logger name="name1"> - <Filter type="type" ... /> - </Logger> - ... - <Root level="level"> - <AppenderRef ref="name"/> - </Root> - </Loggers> -</Configuration> ----- - -Below is a sample configuration using the strict format. - -[source,xml] ----- -<?xml version="1.0" encoding="UTF-8"?> -<Configuration status="debug" strict="true" name="XMLConfigTest" - packages="org.apache.logging.log4j.test"> - <Properties> - <Property name="filename">target/test.log</Property> - </Properties> - <Filter type="ThresholdFilter" level="trace"/> - - <Appenders> - <Appender type="Console" name="STDOUT"> - <Layout type="PatternLayout" pattern="%m MDC%X%n"/> - <Filters> - <Filter type="MarkerFilter" marker="FLOW" onMatch="DENY" onMismatch="NEUTRAL"/> - <Filter type="MarkerFilter" marker="EXCEPTION" onMatch="DENY" onMismatch="ACCEPT"/> - </Filters> - </Appender> - <Appender type="Console" name="FLOW"> - <Layout type="PatternLayout" pattern="%C{1}.%M %m %ex%n"/><!-- class and line number --> - <Filters> - <Filter type="MarkerFilter" marker="FLOW" onMatch="ACCEPT" onMismatch="NEUTRAL"/> - <Filter type="MarkerFilter" marker="EXCEPTION" onMatch="ACCEPT" onMismatch="DENY"/> - </Filters> - </Appender> - <Appender type="File" name="File" fileName="${filename}"> - <Layout type="PatternLayout"> - <Pattern>%d %p %C{1.} [%t] %m%n</Pattern> - </Layout> - </Appender> - </Appenders> - - <Loggers> - <Logger name="org.apache.logging.log4j.test1" level="debug" additivity="false"> - <Filter type="ThreadContextMapFilter"> - <KeyValuePair key="test" value="123"/> - </Filter> - <AppenderRef ref="STDOUT"/> - </Logger> - - <Logger name="org.apache.logging.log4j.test2" level="debug" additivity="false"> - <AppenderRef ref="File"/> - </Logger> - - <Root level="trace"> - <AppenderRef ref="STDOUT"/> - </Root> - </Loggers> - -</Configuration> ----- - -[#JSON] -=== Configuration with JSON - -In addition to XML, Log4j can be configured using JSON. The JSON format -is very similar to the concise XML format. Each key represents the name -of a plugin and the key/value pairs associated with it are its -attributes. Where a key contains more than a simple value it itself will -be a subordinate plugin. In the example below, ThresholdFilter, Console, -and PatternLayout are all plugins while the Console plugin will be -assigned a value of STDOUT for its name attribute and the -ThresholdFilter will be assigned a level of debug. - -[source,json] ----- -{ "configuration": { "status": "error", "name": "RoutingTest", - "packages": "org.apache.logging.log4j.test", - "properties": { - "property": { "name": "filename", - "value" : "target/rolling1/rollingtest-$${sd:type}.log" } - }, - "ThresholdFilter": { "level": "debug" }, - "appenders": { - "Console": { "name": "STDOUT", - "PatternLayout": { "pattern": "%m%n" }, - "ThresholdFilter": { "level": "debug" } - }, - "Routing": { "name": "Routing", - "Routes": { "pattern": "$${sd:type}", - "Route": [ - { - "RollingFile": { - "name": "Rolling-${sd:type}", "fileName": "${filename}", - "filePattern": "target/rolling1/test1-${sd:type}.%i.log.gz", - "PatternLayout": {"pattern": "%d %p %c{1.} [%t] %m%n"}, - "SizeBasedTriggeringPolicy": { "size": "500" } - } - }, - { "AppenderRef": "STDOUT", "key": "Audit"} - ] - } - } - }, - "loggers": { - "logger": { "name": "EventLogger", "level": "info", "additivity": "false", - "AppenderRef": { "ref": "Routing" }}, - "root": { "level": "error", "AppenderRef": { "ref": "STDOUT" }} - } - } -} ----- - -Note that in the RoutingAppender the Route element has been declared as -an array. This is valid because each array element will be a Route -component. This won't work for elements such as appenders and filters, -where each element has a different name in the concise format. Appenders -and filters can be defined as array elements if each appender or filter -declares an attribute named "type" that contains the type of the -appender. The following example illustrates this as well as how to -declare multiple loggers as an array. - -[source,json] ----- -{ "configuration": { "status": "debug", "name": "RoutingTest", - "packages": "org.apache.logging.log4j.test", - "properties": { - "property": { "name": "filename", - "value" : "target/rolling1/rollingtest-$${sd:type}.log" } - }, - "ThresholdFilter": { "level": "debug" }, - "appenders": { - "appender": [ - { "type": "Console", "name": "STDOUT", "PatternLayout": { "pattern": "%m%n" }, "ThresholdFilter": { "level": "debug" }}, - { "type": "Routing", "name": "Routing", - "Routes": { "pattern": "$${sd:type}", - "Route": [ - { - "RollingFile": { - "name": "Rolling-${sd:type}", "fileName": "${filename}", - "filePattern": "target/rolling1/test1-${sd:type}.%i.log.gz", - "PatternLayout": {"pattern": "%d %p %c{1.} [%t] %m%n"}, - "SizeBasedTriggeringPolicy": { "size": "500" } - } - }, - { "AppenderRef": "STDOUT", "key": "Audit"} - ] - } - } - ] - }, - "loggers": { - "logger": [ - { "name": "EventLogger", "level": "info", "additivity": "false", - "AppenderRef": { "ref": "Routing" }}, - { "name": "com.foo.bar", "level": "error", "additivity": "false", - "AppenderRef": { "ref": "STDOUT" }} - ], - "root": { "level": "error", "AppenderRef": { "ref": "STDOUT" }} - } - } -} ----- - -Additional xref:runtime-dependencies.adoc[runtime dependencies] are -required for using JSON configuration files. - -[#YAML] -=== Configuration with YAML - -Log4j also supports using YAML for configuration files. The structure -follows the same pattern as both the XML and YAML configuration formats. -For example: - -[source,yaml] ----- -Configuration: - status: warn - name: YAMLConfigTest - properties: - property: - name: filename - value: target/test-yaml.log - thresholdFilter: - level: debug - appenders: - Console: - name: STDOUT - target: SYSTEM_OUT - PatternLayout: - Pattern: "%m%n" - File: - name: File - fileName: ${filename} - PatternLayout: - Pattern: "%d %p %C{1.} [%t] %m%n" - Filters: - ThresholdFilter: - level: error - - Loggers: - logger: - - - name: org.apache.logging.log4j.test1 - level: debug - additivity: false - ThreadContextMapFilter: - KeyValuePair: - key: test - value: 123 - AppenderRef: - ref: STDOUT - - - name: org.apache.logging.log4j.test2 - level: debug - additivity: false - AppenderRef: - ref: File - Root: - level: error - AppenderRef: - ref: STDOUT - ----- - -Additional xref:runtime-dependencies.adoc[runtime dependencies] are -required for using YAML configuration files. - -[#Properties] -=== Configuration with Properties - -As of version 2.4, Log4j now supports configuration via properties -files. Note that the property syntax is NOT the same as the syntax used -in Log4j 1. Like the XML and JSON configurations, properties -configurations define the configuration in terms of plugins and -attributes to the plugins. - -Prior to version 2.6, the properties configuration requires that you -list the identifiers of the appenders, filters and loggers, in a comma -separated list in properties with those names. Each of those components -will then be expected to be defined in sets of properties that begin -with _component.<.identifier>._. The identifier does not have to match -the name of the component being defined but must uniquely identify all -the attributes and subcomponents that are part of the component. If the -list of identifiers is not present the identifier must not contain a '.'. -Each individual component MUST have a "type" attribute specified that -identifies the component's Plugin type. - -As of version 2.6, this list of identifiers is no longer required as -names are inferred upon first usage, however if you wish to use more -complex identifies you must still use the list. If the list is present -it will be used. - -Unlike the base components, when creating subcomponents you cannot -specify an element containing a list of identifiers. Instead, you must -define the wrapper element with its type as is shown in the policies -definition in the rolling file appender below. You then define each of -the subcomponents below that wrapper element, as the -TimeBasedTriggeringPolicy and SizeBasedTriggeringPolicy are defined -below. - -As of version 2.17.2, `rootLogger` and `logger._key_` properties can be specified to set the -level and zero or more appender refs to create for that logger. The level and appender refs are -separated by comma `,` characters with optional whitespace surrounding the comma. The -following example demonstrates how the shorthand is expanded when reading properties configurations. - -[source,properties] ----- -appender.stdout.type = Console -# ... other appender properties -appender.file.type = File -# ... other appender properties -logger.app = INFO, stdout, file -logger.app.name = com.example.app - -# is equivalent to: -# appender.stdout.type = Console -# appender.stdout.name = stdout -# ... -appender.file.type = File -appender.file.name = file -# ... -logger.app.name = com.example.app -logger.app.level = INFO -logger.app.appenderRef.$1.ref = stdout -logger.app.appenderRef.$2.ref = file ----- - -Properties configuration files support the advertiser, monitorInterval, -name, packages, shutdownHook, shutdownTimeout, status, verbose, and dest -attributes. See link:#ConfigurationSyntax[Configuration Syntax] for the -definitions of these attributes. - -[source,properties] ----- -status = error -dest = err -name = PropertiesConfig - -property.filename = target/rolling/rollingtest.log - -filter.threshold.type = ThresholdFilter -filter.threshold.level = debug - -appender.console.type = Console -appender.console.name = STDOUT -appender.console.layout.type = PatternLayout -appender.console.layout.pattern = %m%n -appender.console.filter.threshold.type = ThresholdFilter -appender.console.filter.threshold.level = error - -appender.rolling.type = RollingFile -appender.rolling.name = RollingFile -appender.rolling.fileName = ${filename} -appender.rolling.filePattern = target/rolling2/test1-%d{MM-dd-yy-HH-mm-ss}-%i.log.gz -appender.rolling.layout.type = PatternLayout -appender.rolling.layout.pattern = %d %p %C{1.} [%t] %m%n -appender.rolling.policies.type = Policies -appender.rolling.policies.time.type = TimeBasedTriggeringPolicy -appender.rolling.policies.time.interval = 2 -appender.rolling.policies.time.modulate = true -appender.rolling.policies.size.type = SizeBasedTriggeringPolicy -appender.rolling.policies.size.size=100MB -appender.rolling.strategy.type = DefaultRolloverStrategy -appender.rolling.strategy.max = 5 - -logger.rolling.name = com.example.my.app -logger.rolling.level = debug -logger.rolling.additivity = false -logger.rolling.appenderRef.rolling.ref = RollingFile - -rootLogger.level = info -rootLogger.appenderRef.stdout.ref = STDOUT - ----- - - -[#Loggers] -=== Configuring Loggers - -An understanding of how loggers work in Log4j is critical before trying -to configure them. Please reference the Log4j -xref:manual/architecture.adoc[architecture] if more information is required. -Trying to configure Log4j without understanding those concepts will lead -to frustration. - -A LoggerConfig is configured using the `logger` element. The `logger` -element must have a name attribute specified, will usually have a level -attribute specified and may also have an additivity attribute specified. -The level may be configured with one of TRACE, DEBUG, INFO, WARN, ERROR, -ALL or OFF. If no level is specified it will default to ERROR. The -additivity attribute may be assigned a value of true or false. If the -attribute is omitted the default value of true will be used. - -Capturing location information (the class name, file name, method name, and line number of the caller) -can be slow. Log4j tries to optimize this by reducing the size of the stack that must be traversed -to find the caller of the logging method. It does this by determining if any component that might -be accessed requires location information. This can cause performance issues if a logger is configured -at a level like trace or debug with the expectation that most logs will be filtered on an Appender -reference or Appender as Log4j will calculate the location information even though the log event -is going to be discarded. To disable this behavior the `includeLocation` attribute -can be set to false on the LoggerConfig. This will cause Log4j to defer calculating the location -information until absolutely necessary. - -A LoggerConfig (including the root LoggerConfig) can be configured with -properties that will be added to the properties copied from the -ThreadContextMap. These properties can be referenced from Appenders, -Filters, Layouts, etc just as if they were part of the ThreadContext -Map. The properties can contain variables that will be resolved either -when the configuration is parsed or dynamically when each event is -logged. See link:#PropertySubstitution[Property Substitution] for more -information on using variables. - -The LoggerConfig may also be configured with one or more AppenderRef -elements. Each appender referenced will become associated with the -specified LoggerConfig. If multiple appenders are configured on the -LoggerConfig each of them be called when processing logging events. - -*_Every configuration must have a root logger_*. If one is not -configured the default root LoggerConfig, which has a level of ERROR and -has a Console appender attached, will be used. The main differences -between the root logger and other loggers are - -1. The root logger does not have a name attribute. -2. The root logger does not support the additivity attribute since it -has no parent. - [#Appenders] === Configuring Appenders @@ -988,299 +316,6 @@ that contains the layout plugin's name. The various appenders will contain other attributes or elements that are required for them to function properly. -[#Filters] -=== Configuring Filters - -Log4j allows a filter to be specified in any of 4 places: - -1. At the same level as the appenders, loggers and properties elements. -These filters can accept or reject events before they have been passed -to a LoggerConfig. -2. In a logger element. These filters can accept or reject events for -specific loggers. -3. In an appender element. These filters can prevent or cause events to -be processed by the appender. -4. In an appender reference element. These filters are used to -determine if a Logger should route the event to an appender. - -Although only a single `filter` element can be configured, that element -may be the `filters` element which represents the CompositeFilter. The -`filters` element allows any number of `filter` elements to be -configured within it. The following example shows how multiple filters -can be configured on the ConsoleAppender. - -[source,xml] ----- -<?xml version="1.0" encoding="UTF-8"?> -<Configuration status="debug" name="XMLConfigTest" packages="org.apache.logging.log4j.test"> - <Properties> - <Property name="filename">target/test.log</Property> - </Properties> - <ThresholdFilter level="trace"/> - - <Appenders> - <Console name="STDOUT"> - <PatternLayout pattern="%m MDC%X%n"/> - </Console> - <Console name="FLOW"> - <!-- this pattern outputs class name and line number --> - <PatternLayout pattern="%C{1}.%M %m %ex%n"/> - <filters> - <MarkerFilter marker="FLOW" onMatch="ACCEPT" onMismatch="NEUTRAL"/> - <MarkerFilter marker="EXCEPTION" onMatch="ACCEPT" onMismatch="DENY"/> - </filters> - </Console> - <File name="File" fileName="${filename}"> - <PatternLayout> - <pattern>%d %p %C{1.} [%t] %m%n</pattern> - </PatternLayout> - </File> - </Appenders> - - <Loggers> - <Logger name="org.apache.logging.log4j.test1" level="debug" additivity="false"> - <ThreadContextMapFilter> - <KeyValuePair key="test" value="123"/> - </ThreadContextMapFilter> - <AppenderRef ref="STDOUT"/> - </Logger> - - <Logger name="org.apache.logging.log4j.test2" level="debug" additivity="false"> - <Property name="user">${sys:user.name}</Property> - <AppenderRef ref="File"> - <ThreadContextMapFilter> - <KeyValuePair key="test" value="123"/> - </ThreadContextMapFilter> - </AppenderRef> - <AppenderRef ref="STDOUT" level="error"/> - </Logger> - - <Root level="trace"> - <AppenderRef ref="STDOUT"/> - </Root> - </Loggers> - -</Configuration> ----- - -[#PropertySubstitution] -== Property Substitution - -Log4j 2 supports the ability to specify tokens in the configuration as -references to properties defined elsewhere. Some of these properties -will be resolved when the configuration file is interpreted while others -may be passed to components where they will be evaluated at runtime. To -accomplish this, Log4j uses variations of -https://commons.apache.org/proper/commons-lang/[Apache Commons Lang]'s -link:../javadoc/log4j-core/org/apache/logging/log4j/core/lookup/StrSubstitutor.html[`StrSubstitutor`] -and -link:../javadoc/log4j-core/org/apache/logging/log4j/core/lookup/StrLookup.html[`StrLookup`] -classes. In a manner similar to Ant or Maven, this allows variables -declared as `$\{name}` to be resolved using properties declared in the -configuration itself. For example, the following example shows the -filename for the rolling file appender being declared as a property. - -[source,xml] ----- -<?xml version="1.0" encoding="UTF-8"?> -<Configuration status="debug" name="RoutingTest" packages="org.apache.logging.log4j.test"> - <Properties> - <Property name="filename">target/rolling1/rollingtest-$${sd:type}.log</Property> - </Properties> - <ThresholdFilter level="debug"/> - - <Appenders> - <Console name="STDOUT"> - <PatternLayout pattern="%m%n"/> - <ThresholdFilter level="debug"/> - </Console> - <Routing name="Routing"> - <Routes pattern="$${sd:type}"> - <Route> - <RollingFile name="Rolling-${sd:type}" fileName="${filename}" - filePattern="target/rolling1/test1-${sd:type}.%i.log.gz"> - <PatternLayout> - <pattern>%d %p %c{1.} [%t] %m%n</pattern> - </PatternLayout> - <SizeBasedTriggeringPolicy size="500" /> - </RollingFile> - </Route> - <Route ref="STDOUT" key="Audit"/> - </Routes> - </Routing> - </Appenders> - - <Loggers> - <Logger name="EventLogger" level="info" additivity="false"> - <AppenderRef ref="Routing"/> - </Logger> - - <Root level="error"> - <AppenderRef ref="STDOUT"/> - </Root> - </Loggers> - -</Configuration> ----- - -While this is useful, there are many more places properties can -originate from. To accommodate this, Log4j also supports the syntax -`${prefix:name}` where the prefix identifies tells Log4j that variable -name should be evaluated in a specific context. See the -xref:manual/lookups.adoc[Lookups] manual page for more details. The contexts -that are built in to Log4j are: - -[cols="1m,5"] -|=== -|Prefix |Context - - <tr> - <td>base64</td> - <td> - Base64 encoded data. The format is <code>${base64:Base64_encoded_data}</code>. - For example: - <code>${base64:SGVsbG8gV29ybGQhCg==}</code> yields <code>Hello World!</code>. - </td> - </tr> - -|base64 -|Base64 encoded data. The format is `${base64:Base64_encoded_data}`. -For example: `${base64:SGVsbG8gV29ybGQhCg==}` yields `Hello World!`. - -|bundle -|Resource bundle. The format is `${bundle:BundleName:BundleKey}`. -The bundle name follows package naming conventions, for example: -`${bundle:com.domain.Messages:MyKey}`. - -|ctx -|Thread Context Map (MDC) - -|date -|Inserts the current date and/or time using the specified format - -|docker -| Returns attributes from the Docker container the application is running in. The format is ${docker:some.attribute}. See xref:log4j-docker.adoc[Docker documentation] for requirements and a list of available attributes. - -|env -|System environment variables. The formats are `${env:ENV_NAME}` and `${env:ENV_NAME:-default_value}`. - -| event -| Retrieves values from fields within the log event. The format is ${event:some.field}. See the Lookups manual page for a list of available fields. -| java -| Retrieves information about the Java environment the application is running in. The format is ${java:some.property}. See the Lookups manual page for a list of available properties. - -|jndi -|A value set in the default JNDI Context. - -|jvmrunargs -|A JVM input argument accessed through JMX, but not a main argument; see -https://docs.oracle.com/javase/6/docs/api/java/lang/management/RuntimeMXBean.html#getInputArguments--[RuntimeMXBean.getInputArguments()]. -Not available on Android. - -| k8s -| Returns attributes from the Kubernetes environment the application is running in. The format is ${k8s:some.attribute}. See the Lookups manual page for a list of available attributes. - -|log4j -|Log4j configuration properties. The expressions -`${log4j:configLocation}` and `${log4j:configParentLocation}` -respectively provide the absolute path to the log4j configuration file -and its parent folder. - -| lower -| Converts the passed in argument to lower case (usually used with nested lookups). The format is ${lower:argument}. - -|main -|A value set with -../log4j-core/apidocs/org/apache/logging/log4j/core/lookup/MapLookup.html#setMainArguments-java.lang.String:A-[MapLookup.setMainArguments(String[])] - -|map -|A value from a MapMessage - -| marker -| Allows use of markers in configurations. The formats are ${marker:} and ${marker:some.name}. See the Lookups manual page for further details. - -|sd -|A value from a StructuredDataMessage. The key "id" will return the -name of the StructuredDataId without the enterprise number. The key -"type" will return the message type. Other keys will retrieve individual -elements from the Map. - -| spring -| Returns values of Spring properties from the Spring configuration. The format is ${spring:some.property}. See the Lookups manual page for requirements and details. - -|sys -|System properties. The formats are `${sys:some.property}` and -`${sys:some.property:-default_value}`. - -| upper -| Converts the passed in argument to upper case (usually used with nested lookups). The format is ${upper:argument}. -| web -| Returns values of variables associated with the Servlet Context. The format is ${spring:some.key}. See the Lookups manual page for a list of available keys. -|=== - -[#DefaultProperties] -== Default Properties -A default property map can be declared in the configuration file by placing a Properties -element directly after the Configuration element and before any Loggers, Filters, -Appenders, etc. are declared. If the value cannot be located in the specified lookup the -value in the default property map will be used. The default map is pre-populated with a value -for "hostName" that is the current system's host name or IP address and -the "contextName" with is the value of the current logging context. See many places -a Properties element is used in this section for examples. - -Default properties may also be specified in the Lookup by using the syntax `${lookupName:key:-defaultValue}`. -In some cases the key might contain a leading '-'. When this is the case an escape character must be -included, such as ``${main:\--file:-app.properties}`. This would use the -`MainMapLookup` for a key named `--file`. If the key is not found then -<code>app.properties</code> would be used as the default value. - -[#EnablingMessagePatternLookups] -== Enabling Message Pattern Lookups -A message is processed (by default) without using lookups, for example if you defined -`<Property name="foo.bar">FOO_BAR</Property>`, then `logger.info("${foo.bar}")` will output `${foo.bar}` instead of `FOO_BAR`. -You could enable message pattern lookups by defining the message pattern using `%m\{lookups}`. - -[#RuntimeLookup] -== Lookup Variables with Multiple Leading '$' Characters - -An interesting feature of StrLookup processing is that when a variable -reference is declared with multiple leading '$' characters each time the -variable is resolved the leading '$' is simply removed. In the previous -example the "Routes" element is capable of resolving the variable at -runtime. To allow this the prefix value is specified as a variable with -two leading '$' characters. When the configuration file is first -processed the first '$' character is simply removed. Thus, when the -Routes element is evaluated at runtime it is the variable declaration -"$\{sd:type}" which causes the event to be inspected for a -StructuredDataMessage and if one is present the value of its type -attribute to be used as the routing key. Not all elements support -resolving variables at runtime. Components that do will specifically -call that out in their documentation. - -If no value is found for the key in the Lookup associated with the -prefix then the value associated with the key in the properties -declaration in the configuration file will be used. If no value is found -the variable declaration will be returned as the value. Default values -may be declared in the configuration by doing: - -[source,xml] ----- -<?xml version="1.0" encoding="UTF-8"?> -<Configuration> - <Properties> - <Property name="type">Audit</property> - </Properties> - ... -</Configuration> ----- - -_As a footnote, it is worth pointing out that the variables in the -RollingFile appender declaration will also not be evaluated when the -configuration is processed. This is simply because the resolution of the -whole RollingFile element is deferred until a match occurs. See -xref:manual/appenders.adoc#RoutingAppender[RoutingAppender] for more -information._ - [#Scripts] == Scripts @@ -1677,43 +712,4 @@ StatusConsoleListener listener = new StatusConsoleListener(Level.ERROR); StatusLogger.getLogger().registerListener(listener); ---- -[#UnitTestingInMaven] -== Testing in Maven - -Maven can run unit and functional tests during the build cycle. By -default, any files placed in `src/test/resources` are automatically -copied to target/test-classes and are included in the classpath during -execution of any tests. As such, placing a log4j2-test.xml into this -directory will cause it to be used instead of a log4j2.xml or -log4j2.json that might be present. Thus a different log configuration -can be used during testing than what is used in production. - -A second approach, which is extensively used by Log4j 2, is to set the -log4j2.configurationFile property in the method annotated with -@BeforeClass in the junit test class. This will allow an arbitrarily -named file to be used during the test. - -A third approach, also used extensively by Log4j 2, is to use the -`LoggerContextRule` JUnit test rule which provides additional -convenience methods for testing. This requires adding the `log4j-core` -`test-jar` dependency to your test scope dependencies. For example: - -[source,java] ----- -public class AwesomeTest { - @Rule - public LoggerContextRule init = new LoggerContextRule("MyTestConfig.xml"); - - @Test - public void testSomeAwesomeFeature() { - final LoggerContext ctx = init.getLoggerContext(); - final Logger logger = init.getLogger("org.apache.logging.log4j.my.awesome.test.logger"); - final Configuration cfg = init.getConfiguration(); - final ListAppender app = init.getListAppender("List"); - logger.warn("Test message"); - final List<LogEvent> events = app.getEvents(); - // etc. - } -} ----- diff --git a/src/site/antora/modules/ROOT/pages/manual/filters.adoc b/src/site/antora/modules/ROOT/pages/manual/filters.adoc index 1a616f5baf..134da34fcd 100644 --- a/src/site/antora/modules/ROOT/pages/manual/filters.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/filters.adoc @@ -14,32 +14,77 @@ See the License for the specific language governing permissions and limitations under the License. //// +[id=filters] = Filters Ralph Goers <[email protected]> Volkan Yazıcı <[email protected]> -Filters allow Log Events to be evaluated to determine if or how they -should be published. A Filter will be called on one of its `filter` -methods and will return a `Result`, which is an Enum that has one of 3 -values - `ACCEPT`, `DENY` or `NEUTRAL`. - -Filters may be configured in one of four locations: - -1. Context-wide Filters are configured directly in the configuration. -Events that are rejected by these filters will not be passed to loggers -for further processing. Once an event has been accepted by a -Context-wide filter it will not be evaluated by any other Context-wide -Filters nor will the Logger's Level be used to filter the event. The -event will be evaluated by Logger and Appender Filters however. -2. Logger Filters are configured on a specified Logger. These are -evaluated after the Context-wide Filters and the Log Level for the -Logger. Events that are rejected by these filters will be discarded and -the event will not be passed to a parent Logger regardless of the -additivity setting. -3. Appender Filters are used to determine if a specific Appender should -handle the formatting and publication of the event. -4. Appender Reference Filters are used to determine if a Logger should -route the event to an appender. +Log4j supports filtering of log events at each level of the logging pipeline using two features: + +* the `level` attributes that can be set on loggers and appender references, +* filter components that can be attached to loggers, appenders, appender references or the global configuration object. + +Filters evaluate the parameters of a logging call (context-wide filter) or a log event and return one of three results: + +ACCEPT:: The log event is accepted by the filter and goes to the next stage of the logging pipeline, + +DENY:: The log event is unconditionally dropped, + +NEUTRAL:: Log4j behaves as if the filter was not present. + +To decide whether a log event from a certain logger is delivered to a specific appender, the following procedure is followed: + +[tabs] +==== +XML:: ++ +[source,xml] +---- +include::example$configuration/filters.xml[] +---- + +JSON:: ++ +[source,json] +---- +include::example$configuration/filters.json[] +---- + +YAML:: ++ +[source,yaml] +---- +include::example$configuration/filters.yaml[] +---- + +Java properties:: ++ +[source,properties] +---- +include::example$configuration/filters.properties[] +---- +==== +<1> First the context-wide filter is consulted. +If it returns `ACCEPT` the log message goes directly to point 3. +<2> Then Log4j checks the message against the configured logger level. +<3> The filter configured on a logger is applied next. +If the logger is additive, the filter on the parent logger is applied recursively until we end up on the logger that references the given appender. +<4> Next comes the turn of the filter configured on an appender reference, +<5> followed by a level check against the configured level of the reference. +<6> The process ends with the filter attached to an appender. + +[CAUTION] +==== +For performance reasons log events should be filtered as soon as possible in the logging pipeline. +This reduces the costs (formatting, transfer through an asynchronous barrier) of disabled log events. +==== + +[TIP] +==== +Users migrating from Log4j 1 often replace the `threshold` property of a Log4j 1 appender with a <<ThresholdFilter>> on the equivalent Log4j 2 appender. + +Using the `level` property of appender references will give a better performance. +==== [#BurstFilter] == BurstFilter diff --git a/src/site/antora/modules/ROOT/pages/manual/lookups.adoc b/src/site/antora/modules/ROOT/pages/manual/lookups.adoc index 1ac6898e46..58c8b13837 100644 --- a/src/site/antora/modules/ROOT/pages/manual/lookups.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/lookups.adoc @@ -107,8 +107,8 @@ Log4j Docker provides access to the following container attributes: This Lookup is subject to the requirements listed at xref:log4j-docker.adoc[Log4j Docker Support] -[#EnvironmentLookup] -== Environment Lookup +[id=environment-lookup] +== [[EnvironmentLookup]] Environment Lookup The EnvironmentLookup allows systems to configure environment variables, either in global files such as /etc/profile or in the startup scripts @@ -596,8 +596,8 @@ while "type" would have to be an item in the Map in a MapMessage. </Routing> ---- -[#SystemPropertiesLookup] -== System Properties Lookup +[id=system-properties-lookup] +== [[SystemPropertiesLookup]] System Properties Lookup As it is quite common to define values inside and outside the application by using System Properties, it is only natural that they diff --git a/src/site/antora/modules/ROOT/pages/plugin-reference.adoc b/src/site/antora/modules/ROOT/pages/plugin-reference.adoc index c3417aa050..628d310c92 100644 --- a/src/site/antora/modules/ROOT/pages/plugin-reference.adoc +++ b/src/site/antora/modules/ROOT/pages/plugin-reference.adoc @@ -18,3 +18,768 @@ Licensed to the Apache Software Foundation (ASF) under one or more This file is a stub. Its content will be auto-generated during build. + +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-AbstractBuilder] +== `AbstractBuilder` +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-appender-AppenderBuilder] +== `AppenderBuilder` +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-appender-AsyncAppenderBuilder] +== org.apache.log4j.AsyncAppender +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-appender-ConsoleAppenderBuilder] +== org.apache.log4j.ConsoleAppender +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-appender-DailyRollingFileAppenderBuilder] +== org.apache.log4j.DailyRollingFileAppender +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-appender-EnhancedRollingFileAppenderBuilder] +== org.apache.log4j.rolling.RollingFileAppender +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-appender-FileAppenderBuilder] +== org.apache.log4j.FileAppender +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-appender-NullAppenderBuilder] +== org.apache.log4j.varia.NullAppender +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-appender-RewriteAppenderBuilder] +== org.apache.log4j.rewrite.RewriteAppender +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-appender-RollingFileAppenderBuilder] +== org.apache.log4j.RollingFileAppender +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-appender-SocketAppenderBuilder] +== org.apache.log4j.net.SocketAppender +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-appender-SyslogAppenderBuilder] +== org.apache.log4j.net.SyslogAppender +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-Builder] +== `Builder` +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-filter-DenyAllFilterBuilder] +== org.apache.log4j.varia.DenyAllFilter +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-filter-FilterBuilder] +== `FilterBuilder` +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-filter-LevelMatchFilterBuilder] +== org.apache.log4j.varia.LevelMatchFilter +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-filter-LevelRangeFilterBuilder] +== org.apache.log4j.varia.LevelRangeFilter +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-filter-StringMatchFilterBuilder] +== org.apache.log4j.varia.StringMatchFilter +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-layout-HtmlLayoutBuilder] +== org.apache.log4j.HTMLLayout +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-layout-LayoutBuilder] +== `LayoutBuilder` +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-layout-PatternLayoutBuilder] +== org.apache.log4j.PatternLayout +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-layout-SimpleLayoutBuilder] +== org.apache.log4j.SimpleLayout +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-layout-TTCCLayoutBuilder] +== org.apache.log4j.TTCCLayout +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-layout-XmlLayoutBuilder] +== org.apache.log4j.xml.XMLLayout +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-Parser] +== `Parser` +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-rolling-CompositeTriggeringPolicyBuilder] +== org.apache.log4j.rolling.CompositeTriggeringPolicy +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-rolling-SizeBasedTriggeringPolicyBuilder] +== org.apache.log4j.rolling.SizeBasedTriggeringPolicy +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-rolling-TimeBasedRollingPolicyBuilder] +== org.apache.log4j.rolling.TimeBasedRollingPolicy +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-builders-rolling-TriggeringPolicyBuilder] +== `TriggeringPolicyBuilder` +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-config-PropertiesConfigurationFactory] +== Log4j1PropertiesConfigurationFactory +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-layout-Log4j1SyslogLayout] +== Log4j1SyslogLayout +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-layout-Log4j1XmlLayout] +== Log4j1XmlLayout +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-pattern-Log4j1LevelPatternConverter] +== Log4j1LevelPatternConverter +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-pattern-Log4j1MdcPatternConverter] +== Log4j1MdcPatternConverter +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-pattern-Log4j1NdcPatternConverter] +== Log4j1NdcPatternConverter +[#org-apache-logging-log4j_log4j-1-2-api_org-apache-log4j-xml-XmlConfigurationFactory] +== Log4j1XmlConfigurationFactory +[#org-apache-logging-log4j_log4j-cassandra_com-datastax-driver-core-BatchStatement-Type] +== `Type` +[#org-apache-logging-log4j_log4j-cassandra_org-apache-logging-log4j-cassandra-CassandraAppender] +== Cassandra +[#org-apache-logging-log4j_log4j-core_com-conversantmedia-util-concurrent-SpinPolicy] +== `SpinPolicy` +[#org-apache-logging-log4j_log4j-core_org-apache-commons-csv-QuoteMode] +== `QuoteMode` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-AbstractLifeCycle] +== `AbstractLifeCycle` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-AbstractAppender] +== `AbstractAppender` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-AbstractOutputStreamAppender] +== `AbstractOutputStreamAppender` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-AbstractWriterAppender] +== `AbstractWriterAppender` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-Appender] +== `Appender` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-AppenderSet] +== AppenderSet +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-AsyncAppender] +== Async +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-ConsoleAppender] +== Console +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-ConsoleAppender-Target] +== `Target` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-CountingNoOpAppender] +== CountingNoOp +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-db-AbstractDatabaseAppender] +== `AbstractDatabaseAppender` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-db-ColumnMapping] +== ColumnMapping +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-db-jdbc-AbstractConnectionSource] +== `AbstractConnectionSource` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-db-jdbc-AbstractDriverManagerConnectionSource] +== `AbstractDriverManagerConnectionSource` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-db-jdbc-ColumnConfig] +== Column +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-db-jdbc-ConnectionSource] +== `ConnectionSource` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-db-jdbc-DataSourceConnectionSource] +== DataSource +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-db-jdbc-DriverManagerConnectionSource] +== DriverManager +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-db-jdbc-FactoryMethodConnectionSource] +== ConnectionFactory +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-db-jdbc-JdbcAppender] +== JDBC +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-FailoverAppender] +== Failover +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-FailoversPlugin] +== failovers +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-FileAppender] +== File +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-HttpAppender] +== Http +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-MemoryMappedFileAppender] +== MemoryMappedFile +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-mom-jeromq-JeroMqAppender] +== JeroMQ +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-mom-JmsAppender] +== JMS +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-mom-kafka-KafkaAppender] +== Kafka +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-nosql-NoSqlAppender] +== NoSql +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-NullAppender] +== Null +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-OutputStreamAppender] +== OutputStream +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-RandomAccessFileAppender] +== RandomAccessFile +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rewrite-LoggerNameLevelRewritePolicy] +== LoggerNameLevelRewritePolicy +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rewrite-MapRewritePolicy] +== MapRewritePolicy +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rewrite-PropertiesRewritePolicy] +== PropertiesRewritePolicy +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rewrite-RewriteAppender] +== Rewrite +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rewrite-RewritePolicy] +== `RewritePolicy` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-AbstractRolloverStrategy] +== `AbstractRolloverStrategy` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-AbstractTriggeringPolicy] +== `AbstractTriggeringPolicy` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-action-AbstractAction] +== `AbstractAction` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-action-AbstractPathAction] +== `AbstractPathAction` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-action-Action] +== `Action` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-action-DeleteAction] +== Delete +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-action-Duration] +== `Duration` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-action-IfAccumulatedFileCount] +== IfAccumulatedFileCount +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-action-IfAccumulatedFileSize] +== IfAccumulatedFileSize +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-action-IfAll] +== IfAll +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-action-IfAny] +== IfAny +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-action-IfFileName] +== IfFileName +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-action-IfLastModified] +== IfLastModified +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-action-IfNot] +== IfNot +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-action-PathCondition] +== `PathCondition` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-action-PathSortByModificationTime] +== SortByModificationTime +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-action-PathSorter] +== `PathSorter` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-action-PosixViewAttributeAction] +== PosixViewAttribute +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-action-ScriptCondition] +== ScriptCondition +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-CompositeTriggeringPolicy] +== Policies +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-CronTriggeringPolicy] +== CronTriggeringPolicy +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-DefaultRolloverStrategy] +== DefaultRolloverStrategy +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-DirectFileRolloverStrategy] +== `DirectFileRolloverStrategy` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-DirectWriteRolloverStrategy] +== DirectWriteRolloverStrategy +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-RollingFileAppender] +== RollingFile +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-NoOpTriggeringPolicy] +== NoOpTriggeringPolicy +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-OnStartupTriggeringPolicy] +== OnStartupTriggeringPolicy +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-RollingRandomAccessFileAppender] +== RollingRandomAccessFile +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-RolloverStrategy] +== `RolloverStrategy` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-SizeBasedTriggeringPolicy] +== SizeBasedTriggeringPolicy +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-TimeBasedTriggeringPolicy] +== TimeBasedTriggeringPolicy +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-rolling-TriggeringPolicy] +== `TriggeringPolicy` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-routing-IdlePurgePolicy] +== IdlePurgePolicy +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-routing-PurgePolicy] +== `PurgePolicy` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-routing-Route] +== Route +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-routing-Routes] +== Routes +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-routing-RoutingAppender] +== Routing +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-ScriptAppenderSelector] +== ScriptAppenderSelector +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-SmtpAppender] +== SMTP +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-SocketAppender] +== `SocketAppender` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-SyslogAppender] +== Syslog +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-WriterAppender] +== Writer +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-async-ArrayBlockingQueueFactory] +== ArrayBlockingQueue +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-async-AsyncLoggerConfig] +== asyncLogger +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-async-AsyncLoggerConfig-RootLogger] +== asyncRoot +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-async-AsyncWaitStrategyFactoryConfig] +== AsyncWaitStrategyFactory +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-async-BlockingQueueFactory] +== `BlockingQueueFactory` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-async-DisruptorBlockingQueueFactory] +== DisruptorBlockingQueue +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-async-JCToolsBlockingQueueFactory] +== JCToolsBlockingQueue +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-async-JCToolsBlockingQueueFactory-WaitStrategy] +== `WaitStrategy` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-async-LinkedTransferQueueFactory] +== LinkedTransferQueue +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-AppenderRef] +== AppenderRef +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-AppendersPlugin] +== appenders +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-arbiters-Arbiter] +== `Arbiter` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-arbiters-ClassArbiter] +== ClassArbiter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-arbiters-DefaultArbiter] +== DefaultArbiter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-arbiters-EnvironmentArbiter] +== EnvironmentArbiter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-arbiters-ScriptArbiter] +== ScriptArbiter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-arbiters-SelectArbiter] +== Select +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-arbiters-SystemPropertyArbiter] +== SystemPropertyArbiter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-builder-api-ConfigurationBuilderFactory] +== `ConfigurationBuilderFactory` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-Configuration] +== Configuration +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-ConfigurationAware] +== `ConfigurationAware` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-ConfigurationFactory] +== `ConfigurationFactory` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-CustomLevelConfig] +== CustomLevel +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-CustomLevels] +== CustomLevels +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-DefaultAdvertiser] +== default +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-HttpWatcher] +== http +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-json-JsonConfigurationFactory] +== JsonConfigurationFactory +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-LoggerConfig] +== `LoggerConfig` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-LoggerConfig-RootLogger] +== root +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-LoggersPlugin] +== loggers +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverter] +== `TypeConverter` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-BigDecimalConverter] +== BigDecimal +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-BigIntegerConverter] +== BigInteger +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-BooleanConverter] +== Boolean +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-ByteArrayConverter] +== ByteArray +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-ByteConverter] +== Byte +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-CharacterConverter] +== Character +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-CharArrayConverter] +== CharacterArray +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-CharsetConverter] +== Charset +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-ClassConverter] +== Class +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-CronExpressionConverter] +== CronExpression +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-DoubleConverter] +== Double +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-DurationConverter] +== Duration +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-FileConverter] +== File +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-FloatConverter] +== Float +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-InetAddressConverter] +== InetAddress +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-IntegerConverter] +== Integer +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-LevelConverter] +== Level +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-LongConverter] +== Long +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-PathConverter] +== Path +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-PatternConverter] +== Pattern +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-SecurityProviderConverter] +== SecurityProvider +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-ShortConverter] +== Short +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-StringConverter] +== String +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-UriConverter] +== URI +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-UrlConverter] +== URL +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-plugins-convert-TypeConverters-UuidConverter] +== UUID +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-PropertiesPlugin] +== properties +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-properties-PropertiesConfigurationFactory] +== PropertiesConfigurationFactory +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-Property] +== property +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-ScriptsPlugin] +== scripts +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-xml-XmlConfigurationFactory] +== XmlConfigurationFactory +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-config-yaml-YamlConfigurationFactory] +== YamlConfigurationFactory +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-AbstractFilterable] +== `AbstractFilterable` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-AbstractFilter] +== `AbstractFilter` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-Filter] +== `Filter` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-BurstFilter] +== BurstFilter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-CompositeFilter] +== filters +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-DenyAllFilter] +== DenyAllFilter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-DynamicThresholdFilter] +== DynamicThresholdFilter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-Filterable] +== `Filterable` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-LevelMatchFilter] +== LevelMatchFilter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-LevelRangeFilter] +== LevelRangeFilter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-MapFilter] +== `MapFilter` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-MarkerFilter] +== MarkerFilter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-MutableThreadContextMapFilter] +== MutableThreadContextMapFilter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-NoMarkerFilter] +== NoMarkerFilter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-RegexFilter] +== RegexFilter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-Filter-Result] +== `Result` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-ScriptFilter] +== ScriptFilter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-StringMatchFilter] +== StringMatchFilter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-StructuredDataFilter] +== StructuredDataFilter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-ThreadContextMapFilter] +== ThreadContextMapFilter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-ThresholdFilter] +== ThresholdFilter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-TimeFilter] +== TimeFilter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-impl-LocationAware] +== `LocationAware` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-AbstractCsvLayout] +== `AbstractCsvLayout` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-AbstractJacksonLayout] +== `AbstractJacksonLayout` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-AbstractLayout] +== `AbstractLayout` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-AbstractStringLayout] +== `AbstractStringLayout` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-Layout] +== `Layout` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-CsvLogEventLayout] +== CsvLogEventLayout +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-CsvParameterLayout] +== CsvParameterLayout +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-Encoder] +== `Encoder` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-GelfLayout] +== GelfLayout +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-GelfLayout-CompressionType] +== `CompressionType` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-HtmlLayout] +== HtmlLayout +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-HtmlLayout-FontSize] +== `FontSize` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-JsonLayout] +== JsonLayout +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-LevelPatternSelector] +== LevelPatternSelector +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-LoggerFields] +== LoggerFields +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-MarkerPatternSelector] +== MarkerPatternSelector +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-MessageLayout] +== MessageLayout +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-PatternLayout] +== PatternLayout +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-PatternMatch] +== PatternMatch +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-PatternSelector] +== `PatternSelector` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-Rfc5424Layout] +== Rfc5424Layout +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-ScriptPatternSelector] +== ScriptPatternSelector +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-SerializedLayout] +== SerializedLayout +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-SyslogLayout] +== SyslogLayout +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-XmlLayout] +== XmlLayout +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-layout-YamlLayout] +== YamlLayout +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-LifeCycle2] +== `LifeCycle2` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-LifeCycle] +== `LifeCycle` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-lookup-AbstractConfigurationAwareLookup] +== `AbstractConfigurationAwareLookup` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-lookup-AbstractLookup] +== `AbstractLookup` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-lookup-ContextMapLookup] +== ctx +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-lookup-DateLookup] +== date +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-lookup-EnvironmentLookup] +== env +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-lookup-EventLookup] +== event +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-lookup-JavaLookup] +== java +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-lookup-JmxRuntimeInputArgumentsLookup] +== jvmrunargs +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-lookup-JndiLookup] +== jndi +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-lookup-Log4jLookup] +== log4j +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-lookup-LowerLookup] +== lower +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-lookup-MainMapLookup] +== main +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-lookup-MapLookup] +== `MapLookup` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-lookup-MarkerLookup] +== marker +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-lookup-ResourceBundleLookup] +== bundle +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-lookup-StrLookup] +== `StrLookup` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-lookup-StructuredDataLookup] +== sd +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-lookup-SystemPropertiesLookup] +== sys +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-lookup-UpperLookup] +== upper +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-net-Advertiser] +== `Advertiser` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-net-Facility] +== `Facility` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-net-MulticastDnsAdvertiser] +== multicastdns +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-net-Protocol] +== `Protocol` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-net-Rfc1349TrafficClass] +== `Rfc1349TrafficClass` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-net-SocketAddress] +== SocketAddress +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-net-SocketOptions] +== SocketOptions +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-net-SocketPerformancePreferences] +== SocketPerformancePreferences +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-net-ssl-AbstractKeyStoreConfiguration] +== `AbstractKeyStoreConfiguration` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-net-ssl-KeyStoreConfiguration] +== KeyStore +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-net-ssl-SslConfiguration] +== Ssl +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-net-ssl-StoreConfiguration] +== `StoreConfiguration` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-net-ssl-TrustStoreConfiguration] +== TrustStore +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-AbstractPatternConverter] +== `AbstractPatternConverter` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-AbstractStyleNameConverter] +== `AbstractStyleNameConverter` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-AbstractStyleNameConverter-Black] +== black +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-AbstractStyleNameConverter-Blue] +== blue +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-AbstractStyleNameConverter-Cyan] +== cyan +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-AbstractStyleNameConverter-Green] +== green +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-AbstractStyleNameConverter-Magenta] +== magenta +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-AbstractStyleNameConverter-Red] +== red +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-AbstractStyleNameConverter-White] +== white +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-AbstractStyleNameConverter-Yellow] +== yellow +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-AnsiConverter] +== `AnsiConverter` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-ArrayPatternConverter] +== `ArrayPatternConverter` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-ClassNamePatternConverter] +== ClassNamePatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-DatePatternConverter] +== DatePatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-EncodingPatternConverter] +== encode +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-EndOfBatchPatternConverter] +== EndOfBatchPatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-EqualsBaseReplacementConverter] +== `EqualsBaseReplacementConverter` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-EqualsIgnoreCaseReplacementConverter] +== equalsIgnoreCase +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-EqualsReplacementConverter] +== equals +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-ExtendedThrowablePatternConverter] +== ExtendedThrowablePatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-FileDatePatternConverter] +== FileDatePatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-FileLocationPatternConverter] +== FileLocationPatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-FullLocationPatternConverter] +== FullLocationPatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-HighlightConverter] +== highlight +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-IntegerPatternConverter] +== IntegerPatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-LevelPatternConverter] +== LevelPatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-LineLocationPatternConverter] +== LineLocationPatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-LineSeparatorPatternConverter] +== LineSeparatorPatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-LogEventPatternConverter] +== `LogEventPatternConverter` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-LoggerFqcnPatternConverter] +== LoggerFqcnPatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-LoggerPatternConverter] +== LoggerPatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-MapPatternConverter] +== MapPatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-MarkerPatternConverter] +== MarkerPatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-MarkerSimpleNamePatternConverter] +== MarkerNamePatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-MaxLengthConverter] +== maxLength +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-MdcPatternConverter] +== MdcPatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-MessagePatternConverter] +== MessagePatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-MethodLocationPatternConverter] +== MethodLocationPatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-NamePatternConverter] +== `NamePatternConverter` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-NanoTimePatternConverter] +== NanoTimePatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-NdcPatternConverter] +== NdcPatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-PatternConverter] +== `PatternConverter` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-ProcessIdPatternConverter] +== ProcessIdPatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-RegexReplacement] +== replace +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-RegexReplacementConverter] +== replace +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-RelativeTimePatternConverter] +== RelativeTimePatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-RepeatPatternConverter] +== repeat +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-RootThrowablePatternConverter] +== RootThrowablePatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-SequenceNumberPatternConverter] +== SequenceNumberPatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-StyleConverter] +== style +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-ThreadIdPatternConverter] +== ThreadIdPatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-ThreadNamePatternConverter] +== ThreadPatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-ThreadPriorityPatternConverter] +== ThreadPriorityPatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-ThrowablePatternConverter] +== `ThrowablePatternConverter` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-UuidPatternConverter] +== UuidPatternConverter +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-pattern-VariablesNotEmptyReplacementConverter] +== notEmpty +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-script-AbstractScript] +== `AbstractScript` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-script-Script] +== Script +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-script-ScriptFile] +== ScriptFile +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-script-ScriptRef] +== ScriptRef +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-StringLayout] +== `StringLayout` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-util-AbstractWatcher] +== `AbstractWatcher` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-util-Builder] +== `Builder` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-util-KeyValuePair] +== KeyValuePair +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-util-Watcher] +== `Watcher` +[#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-Level] +== `Level` +[#org-apache-logging-log4j_log4j-core-test_org-apache-logging-log4j-core-test-appender-AlwaysFailAppender] +== AlwaysFail +[#org-apache-logging-log4j_log4j-core-test_org-apache-logging-log4j-core-test-appender-BlockingAppender] +== Block +[#org-apache-logging-log4j_log4j-core-test_org-apache-logging-log4j-core-test-appender-FailOnceAppender] +== FailOnce +[#org-apache-logging-log4j_log4j-core-test_org-apache-logging-log4j-core-test-appender-ListAppender] +== List +[#org-apache-logging-log4j_log4j-core-test_org-apache-logging-log4j-core-test-ExtendedLevels] +== ExtendedLevel +[#org-apache-logging-log4j_log4j-core-test_org-apache-logging-log4j-core-test-junit-TestPropertyLookup] +== test +[#org-apache-logging-log4j_log4j-couchdb_org-apache-logging-log4j-core-appender-nosql-NoSqlProvider] +== `NoSqlProvider` +[#org-apache-logging-log4j_log4j-couchdb_org-apache-logging-log4j-couchdb-CouchDbProvider] +== CouchDB +[#org-apache-logging-log4j_log4j-docker_org-apache-logging-log4j-docker-DockerLookup] +== docker +[#org-apache-logging-log4j_log4j-flume-ng_org-apache-logging-log4j-flume-appender-Agent] +== Agent +[#org-apache-logging-log4j_log4j-flume-ng_org-apache-logging-log4j-flume-appender-FlumeAppender] +== Flume +[#org-apache-logging-log4j_log4j-flume-ng_org-apache-logging-log4j-flume-appender-FlumeEventFactory] +== `FlumeEventFactory` +[#org-apache-logging-log4j_log4j-jakarta-web_org-apache-logging-log4j-web-appender-ServletAppender] +== Servlet +[#org-apache-logging-log4j_log4j-jakarta-web_org-apache-logging-log4j-web-WebLookup] +== web +[#org-apache-logging-log4j_log4j-jdbc-dbcp2_org-apache-logging-log4j-core-appender-db-jdbc-PoolableConnectionFactoryConfig] +== PoolableConnectionFactory +[#org-apache-logging-log4j_log4j-jdbc-dbcp2_org-apache-logging-log4j-core-appender-db-jdbc-PoolingDriverConnectionSource] +== PoolingDriver +[#org-apache-logging-log4j_log4j-jpa_org-apache-logging-log4j-core-appender-db-jpa-JpaAppender] +== JPA +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-JsonTemplateLayout] +== JsonTemplateLayout +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-JsonTemplateLayout-EventTemplateAdditionalField] +== EventTemplateAdditionalField +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-JsonTemplateLayout-EventTemplateAdditionalField-Format] +== `Format` +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-CaseConverterResolverFactory] +== CaseConverterResolverFactory +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-CounterResolverFactory] +== CounterResolverFactory +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-EndOfBatchResolverFactory] +== EndOfBatchResolverFactory +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-EventAdditionalFieldInterceptor] +== EventAdditionalFieldInterceptor +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-EventResolverFactory] +== `EventResolverFactory` +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-EventResolverInterceptor] +== `EventResolverInterceptor` +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-EventRootObjectKeyInterceptor] +== EventRootObjectKeyInterceptor +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-ExceptionResolverFactory] +== ExceptionResolverFactory +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-ExceptionRootCauseResolverFactory] +== ExceptionRootCauseResolverFactory +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-LevelResolverFactory] +== LevelResolverFactory +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-LoggerResolverFactory] +== LoggerResolverFactory +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-MainMapResolverFactory] +== MainMapResolverFactory +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-MapResolverFactory] +== MapResolverFactory +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-MarkerResolverFactory] +== MarkerResolverFactory +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-MessageParameterResolverFactory] +== MessageParameterResolverFactory +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-MessageResolverFactory] +== MessageResolverFactory +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-PatternResolverFactory] +== PatternResolverFactory +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-SourceResolverFactory] +== SourceResolverFactory +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-TemplateResolverFactory] +== `TemplateResolverFactory` +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-TemplateResolverInterceptor] +== `TemplateResolverInterceptor` +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-ThreadContextDataResolverFactory] +== ThreadContextDataResolverFactory +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-ThreadContextStackResolverFactory] +== ThreadContextStackResolverFactory +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-ThreadResolverFactory] +== ThreadResolverFactory +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-resolver-TimestampResolverFactory] +== TimestampResolverFactory +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-util-RecyclerFactory] +== `RecyclerFactory` +[#org-apache-logging-log4j_log4j-layout-template-json_org-apache-logging-log4j-layout-template-json-util-RecyclerFactoryConverter] +== RecyclerFactoryConverter +[#org-apache-logging-log4j_log4j-mongodb4_org-apache-logging-log4j-mongodb4-MongoDb4Provider] +== MongoDb4 +[#org-apache-logging-log4j_log4j-mongodb_org-apache-logging-log4j-mongodb-MongoDbProvider] +== MongoDb +[#org-apache-logging-log4j_log4j-spring-boot_org-apache-logging-log4j-core-config-LoggerContextAware] +== `LoggerContextAware` +[#org-apache-logging-log4j_log4j-spring-boot_org-apache-logging-log4j-spring-boot-SpringLookup] +== spring +[#org-apache-logging-log4j_log4j-spring-boot_org-apache-logging-log4j-spring-boot-SpringProfileArbiter] +== SpringProfile diff --git a/src/site/antora/modules/ROOT/partials/properties-configuration-factory.adoc b/src/site/antora/modules/ROOT/partials/properties-configuration-factory.adoc index d1b921786b..ecf6f5f3f4 100644 --- a/src/site/antora/modules/ROOT/partials/properties-configuration-factory.adoc +++ b/src/site/antora/modules/ROOT/partials/properties-configuration-factory.adoc @@ -45,6 +45,8 @@ If a relative URL is provided, it is interpreted as: * path to a file, if the file exists, * a classpath resource otherwise. +Usage of absolute URLs is restricted by the xref:manual/configuration.adoc#properties-transport-security[Transport Security] configuration options. + See also xref:manual/configuration.adoc#AutomaticConfiguration[Automatic Configuration]. [id=log4j2.level] diff --git a/src/site/antora/modules/ROOT/partials/properties-transport-security.adoc b/src/site/antora/modules/ROOT/partials/properties-transport-security.adoc index 5fa3207019..5c1629ebd8 100644 --- a/src/site/antora/modules/ROOT/partials/properties-transport-security.adoc +++ b/src/site/antora/modules/ROOT/partials/properties-transport-security.adoc @@ -30,7 +30,7 @@ A comma separated list of https://docs.oracle.com/javase/{java-target-version}/d To completely prevent accessing the configuration via the Java `URL` class specify a value of `_none`. -// TODO: What about 'jar:http:'? +NOTE:: Since Log4j does not use `URL` to access `file:` resources, this protocol can not be effectively disabled. [id=log4j2.configurationAuthorizationProvider] == `log4j2.configurationAuthorizationProvider`
