This is an automated email from the ASF dual-hosted git repository. pkarwasz pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
commit 00251183a41d1f1cea614ffbb424dd8b6ad38650 Author: Piotr P. Karwasz <[email protected]> AuthorDate: Fri Aug 9 11:56:23 2024 +0200 Add Log4j 3 specific components --- src/site/antora/modules/ROOT/pages/components.adoc | 332 ++++++++------------- .../modules/ROOT/pages/manual/appenders.adoc | 2 +- .../ROOT/pages/manual/appenders/database.adoc | 4 +- .../ROOT/pages/manual/appenders/delegating.adoc | 12 +- .../ROOT/pages/manual/appenders/message-queue.adoc | 2 +- .../ROOT/pages/manual/appenders/network.adoc | 2 +- .../ROOT/pages/manual/appenders/rolling-file.adoc | 6 + .../antora/modules/ROOT/pages/manual/async.adoc | 2 +- .../modules/ROOT/pages/manual/configuration.adoc | 7 +- .../antora/modules/ROOT/pages/manual/filters.adoc | 12 +- .../modules/ROOT/pages/manual/garbagefree.adoc | 2 +- .../modules/ROOT/pages/manual/installation.adoc | 12 +- src/site/antora/modules/ROOT/pages/manual/jmx.adoc | 108 ------- .../antora/modules/ROOT/pages/manual/layouts.adoc | 22 +- .../antora/modules/ROOT/pages/manual/lookups.adoc | 4 +- .../modules/ROOT/pages/manual/migration.adoc | 28 +- .../modules/ROOT/pages/manual/pattern-layout.adoc | 10 +- .../antora/modules/ROOT/pages/manual/scripts.adoc | 8 +- .../modules/ROOT/pages/migrate-from-logback.adoc | 6 +- .../ROOT/partials/components/log4j-api-test.adoc | 41 --- .../ROOT/partials/components/log4j-appserver.adoc | 41 --- .../log4j-async-logger.adoc} | 10 +- .../ROOT/partials/components/log4j-cassandra.adoc | 41 --- ...og4j-1.2-api.adoc => log4j-config-jackson.adoc} | 5 +- ...j-1.2-api.adoc => log4j-config-properties.adoc} | 4 +- .../{log4j-1.2-api.adoc => log4j-config-yaml.adoc} | 4 +- .../ROOT/partials/components/log4j-core-test.adoc | 8 +- .../ROOT/partials/components/log4j-core.adoc | 8 +- .../ROOT/partials/components/log4j-couchdb.adoc | 41 --- .../{log4j-1.2-api.adoc => log4j-csv.adoc} | 4 +- .../ROOT/partials/components/log4j-docker.adoc | 11 +- .../ROOT/partials/components/log4j-flume-ng.adoc | 4 +- .../ROOT/partials/components/log4j-iostreams.adoc | 40 --- .../ROOT/partials/components/log4j-jcl.adoc | 41 --- .../log4j-jctools.adoc} | 4 +- .../ROOT/partials/components/log4j-jdbc-dbcp2.adoc | 4 +- .../log4j-jdbc.adoc} | 0 .../log4j-jndi.adoc} | 10 +- .../ROOT/partials/components/log4j-jpa.adoc | 41 --- .../ROOT/partials/components/log4j-jpl.adoc | 4 +- .../components/log4j-json-template-layout.adoc | 4 +- .../ROOT/partials/components/log4j-jul.adoc | 4 +- .../log4j-kit.adoc} | 10 +- .../ROOT/partials/components/log4j-mongodb.adoc | 4 +- .../ROOT/partials/components/log4j-mongodb4.adoc | 4 +- ...4j-1.2-api.adoc => log4j-plugin-processor.adoc} | 4 +- .../{log4j-1.2-api.adoc => log4j-plugins.adoc} | 4 +- .../{log4j-1.2-api.adoc => log4j-script.adoc} | 4 +- .../ROOT/partials/components/log4j-slf4j-impl.adoc | 4 +- .../partials/components/log4j-slf4j2-impl.adoc | 4 +- .../log4j-spring-cloud-config-client.adoc | 4 +- .../ROOT/partials/components/log4j-to-jul.adoc | 4 +- .../ROOT/partials/components/log4j-to-slf4j.adoc | 4 +- .../ROOT/partials/components/log4j-web.adoc | 4 +- .../partials/configuration-file-format-deps.adoc | 81 +---- .../log4j-api.adoc => features/api.adoc} | 0 .../appender-jms.adoc} | 0 .../appender-smtp.adoc} | 16 +- .../async-logger.adoc} | 5 +- .../config-json.adoc} | 5 +- .../config-properties.adoc} | 5 +- .../config-xml.adoc} | 14 +- .../config-yaml.adoc} | 5 +- .../layout-csv.adoc} | 5 +- .../queue-jctools.adoc} | 5 +- .../servlet-support.adoc} | 10 +- .../modules/ROOT/partials/manual/api-intro.adoc | 2 +- .../modules/ROOT/partials/manual/log-event.adoc | 14 +- 68 files changed, 334 insertions(+), 842 deletions(-) diff --git a/src/site/antora/modules/ROOT/pages/components.adoc b/src/site/antora/modules/ROOT/pages/components.adoc index 0c3e61a5c1..b354b6b91f 100644 --- a/src/site/antora/modules/ROOT/pages/components.adoc +++ b/src/site/antora/modules/ROOT/pages/components.adoc @@ -32,89 +32,76 @@ include::partial$components/log4j-bom.adoc[] A private Bill-of-Materials used during the compilation and testing of the project. -[CAUTION] +[WARNING] ==== Do not use this artifact, since it also manages versions of **third-party** projects. Use <<log4j-bom>> instead. ==== -[#log4j-12-api] -== `log4j-1.2-api` +[#log4j-async-logger] +== `log4j-async-logger` [cols="1h,5"] |=== | JPMS module -| `org.apache.log4j` +| `org.apache.logging.log4j.async.logger` |=== -The `log4j-1.2-api` artifact contains several tools to help users migrate from Log4j 1 to Log4j 2. +The `log4j-async-logger` artifact contains the implementation of the xref:manual/async.adoc[asynchronous loggers]. -See xref:migrate-from-log4j1.adoc#option-1-use-the-log4j-1-x-bridge-log4j-1-2-api[Log4j 1 to Log4j 2 Bridge] for details. +See xref:manual/async.adoc[asynchronous loggers] for more details. -include::partial$components/log4j-1.2-api.adoc[] +include::partial$components/log4j-async-logger.adoc[] -[#log4j-api] -== `log4j-api` +[#log4j-config-jackson] +== `log4j-config-jackson` [cols="1h,5"] |=== | JPMS module -| `org.apache.logging.log4j` +| `org.apache.logging.log4j.config.jackson` |=== -The `log4j-api` artifact contains the xref:manual/api.adoc[]. +The `log4j-config-jackson` artifact contains base classes to develop +xref:manual/configuration.adoc#configuration-factories[`ConfigurationFactory`] +plugins based on +https://github.com/FasterXML/jackson?tab=readme-ov-file#third-party-datatype-modules[Jackson datatype modules]. -See xref:manual/api.adoc[] for more details. +The <<log4j-config-yaml>> and <<log4j-config-properties>> artifacts use `log4j-config-jackson`. -include::partial$components/log4j-api.adoc[] +See xref:manual/extending.adoc#ConfigurationFactory[Extending `ConfigurationFactory`] for more details on how to create your own configuration file formats. -[#log4j-api-test] -== `log4j-api-test` +include::partial$components/log4j-config-jackson.adoc[] -[cols="1h,5"] -|=== -| JPMS module -| `org.apache.logging.log4j.test` -|=== - -The `log4j-api-test` artifact contains test fixtures useful to test Log4j API implementations. - -include::partial$components/log4j-api-test.adoc[] - -[#log4j-appserver] -== `log4j-appserver` +[#log4j-config-properties] +== `log4j-config-properties` [cols="1h,5"] |=== | JPMS module -| `org.apache.logging.log4j.appserver` +| `org.apache.logging.log4j.config.properties` |=== -The `log4j-appserver` artifact contains: +The `log4j-config-properties` artifact provides support for the Java properties configuration file format. -* A bridge from Tomcat JULI to the Log4j API. -See xref:jakarta.adoc#replace-tomcat[Replacing Tomcat logging system] for more information. -* A bridge from Jetty 9 logging API to the Log4j API. -See xref:jakarta.adoc#replace-jetty[Replacing Jetty logging system] for more information +See xref:manual/configuration.adoc#configuration-factories[predefined `ConfigurationFactory` plugins] for more details. -include::partial$components/log4j-appserver.adoc[] +include::partial$components/log4j-config-properties.adoc[] -[#log4j-cassandra] -== `log4j-cassandra` +[#log4j-config-yaml] +== `log4j-config-yaml` [cols="1h,5"] |=== | JPMS module -| `org.apache.logging.log4j.cassandra` +| `org.apache.logging.log4j.config.yaml` |=== -The `log4j-cassandra` artifact contains an xref:manual/appenders.adoc[appender] for the -https://cassandra.apache.org/_/index.html[Apache Cassandra] -database. +The `log4j-config-properties` artifact provides support for the YAML configuration file format. -See xref:manual/appenders/database.adoc#CassandraAppender[Cassandra Appender] for more information. +See xref:manual/configuration.adoc#configuration-factories[predefined `ConfigurationFactory` plugins] for more details. -include::partial$components/log4j-cassandra.adoc[] +include::partial$components/log4j-config-yaml.adoc[] [#log4j-core] == `log4j-core` @@ -144,26 +131,21 @@ The `log4j-core-test` artifact contains test fixtures useful to xref:manual/exte include::partial$components/log4j-core-test.adoc[] -[#log4j-couchdb] -== `log4j-couchdb` +[#log4j-csv] +== `log4j-csv` + +The `log4j-csv` artifact contains xref:manual/layouts.adoc[layouts] that format log events using +https://commons.apache.org/proper/commons-csv/[Commons CSV]. + +See xref:manual/layouts.adoc#csv-layouts[CSV Layouts] for more details. [cols="1h,5"] |=== | JPMS module -| `org.apache.logging.log4j.couchdb` +| `org.apache.logging.log4j.csv` |=== -The `log4j-couchdb` artifact contains a provider to connect the -xref:manual/appenders/database.adoc#NoSqlAppender[NoSQL Appender] -with the -https://couchdb.apache.org/[Apache CouchDB] -database. - -See -xref:manual/appenders/database.adoc#CouchDbProvider[CouchDB provider] -for more information. - -include::partial$components/log4j-couchdb.adoc[] +include::partial$components/log4j-csv.adoc[] [#log4j-docker] == `log4j-docker` @@ -200,81 +182,36 @@ for more information. include::partial$components/log4j-flume-ng.adoc[] -[#log4j-iostreams] -== `log4j-iostreams` - -[cols="1h,5"] -|=== -| JPMS module -| `org.apache.logging.log4j.iostreams` -|=== - -The `log4j-iostreams` artifact is an extension of the xref:manual/api.adoc[] to connect with legacy stream-based logging methods. - -See xref:log4j-iostreams.adoc[] for more information. - -include::partial$components/log4j-iostreams.adoc[] - -[#log4j-jakarta-smtp] -== `log4j-jakarta-smtp` +[#log4j-jctools] +== `log4j-jctools` |=== | JPMS module -| `org.apache.logging.log4j.jakarta.smtp` +| `org.apache.logging.log4j.jctools` |=== -The `log4j-jakarta-smtp` contains an xref:manual/appenders.adoc[appender] for the -https://jakarta.ee/specifications/mail/2.0/[Jakarta Mail 2.0 API] -and later versions. - -See xref:manual/appenders/network.adoc#SMTPAppender[SMTP Appender] for more information. - -include::partial$components/log4j-jakarta-smtp.adoc[] - -[#log4j-jakarta-web] -== `log4j-jakarta-web` - -|=== -| JPMS module -| `org.apache.logging.log4j.jakarta.web` -|=== - -The `log4j-jakarta-web` contains multiple utils to run your applications in a -https://jakarta.ee/specifications/servlet/5.0/[Jakarta Servlet 5.0] -or later environment: - -* It synchronizes the lifecycle of Log4j Core and your application. -See xref:jakarta.adoc#log4j-jakarta-web[Integrating with web applications] for more details. +The `log4j-jctools` artifact contains a +xref:manual/appenders/delegating.adoc#BlockingQueueFactory[blocking queue factory] +that uses +https://jctools.github.io/JCTools/[JCTools]. -* It contains a xref:manual/lookups.adoc[lookup] for the data contained in a Servlet context. -See xref:manual/lookups.adoc#WebLookup[Web Lookup] for more details. +See xref:manual/appenders/delegating.adoc#JCToolsBlockingQueueFactory[JCTools Blocking Queue] for more details. -* It contains an xref:manual/appenders.adoc[appender] to forward log event to a Servlet. -See xref:manual/appenders.adoc#ServletAppender[Servlet Appender] for more details. +include::partial$components/log4j-jctools.adoc[] -[IMPORTANT] -==== -Don't deploy this artifact together with <<log4j-web>>. -==== - -include::partial$components/log4j-jakarta-web.adoc[] - -[#log4j-jcl] -== `log4j-jcl` +[#log4j-jdbc] +== `log4j-jdbc` |=== | JPMS module -| `org.apache.logging.log4j.jcl` +| `org.apache.logging.log4j.jdbc` |=== -The `log4j-jcl` artifact contains a bridge from -https://commons.apache.org/proper/commons-logging/[Apache Commons Logging] -and the -xref:manual/api.adoc[]. +The `log4j-jdbc` artifact contains an xref:manual/appenders.adoc[appender] that write to a JDBC database. -See xref:manual/installation.adoc#impl-core-bridge-jcl[Installing JCL-to-Log4j API bridge] for more details. +See xref:manual/appenders/database.adoc#JdbcAppender[JDBC Appender] for more details. -include::partial$components/log4j-jcl.adoc[] +include::partial$components/log4j-jdbc.adoc[] [#log4j-jdbc-dbcp2] == `log4j-jdbc-dbcp2` @@ -293,21 +230,22 @@ See xref:manual/appenders/database.adoc#PoolingDriverConnectionSource[`PoolingDr include::partial$components/log4j-jdbc-dbcp2.adoc[] -[#log4j-jpa] -== `log4j-jpa` +[#log4j-jndi] +== `log4j-jndi` |=== | JPMS module -| `org.apache.logging.log4j.jpa` +| `org.apache.logging.log4j.jndi` |=== -The `log4j-jpa` artifact contains an xref:manual/appenders.adoc[appender] for the -https://jakarta.ee/specifications/persistence/2.2/[Jakarta Persistence 2.2 API] -or Java Persistence API. +The `log4j-jndi` adds JNDI support to several Log4j components: -See xref:manual/appenders/database.adoc#JpaAppender[JPA Appender] for more details. +* It provides the xref:manual/lookups.adoc#JndiLookup[JNDI lookup]. +* It provides a xref:manual/appenders/database.adoc#DataSourceConnectionSource[JNDI data source] for the xref:manual/appenders/database.adoc[JDBC Appender]. +* It is internally used by the xref:manual/appenders/message-queue.adoc#JmsAppender[JMS appender]. +* It provides a xref:manual/systemproperties.adoc#log4j.loggerContext.selector[JNDI context selector]. -include::partial$components/log4j-jpa.adoc[] +include::partial$components/log4j-jndi.adoc[] [#log4j-jpl] == `log4j-jpl` @@ -346,6 +284,21 @@ Don't deploy this artifact together with <<log4j-to-jul>>. include::partial$components/log4j-jul.adoc[] +[#log4j-kit] +== `log4j-kit` + +|=== +| JPMS module +| `org.apache.logging.log4j.kit` +|=== + +The `log4j-kit` artifact provides tools to write modern, garbage-free implementations of the +xref:manual/api.adoc[]. + +<<log4j-core,Log4j Core 3>> is based on this artifact. + +include::partial$components/log4j-kit.adoc[] + [#log4j-json-template-layout] == `log4j-json-template-layout` @@ -384,27 +337,55 @@ for more information. include::partial$components/log4j-mongodb.adoc[] -[#log4j-mongodb4] -== `log4j-mongodb4` +[#log4j-plugin-processor] +== `log4j-plugin-processor` -[cols="1h,5"] |=== | JPMS module -| `org.apache.logging.log4j.mongodb4` +| `org.apache.logging.log4j.plugin.processor` |=== -The `log4j-mongodb` artifact contains a provider to connect the -xref:manual/appenders/database.adoc#NoSqlAppender[NoSQL Appender] -with the -https://www.mongodb.com/[MongoDB] -database. -It is based on version 4.x of the Java driver. +The `log4j-plugin-processor` contains an +https://docs.oracle.com/en/java/javase/{java-target-version}/docs/api/java.compiler/javax/annotation/processing/Processor.html[annotation processor] +used to compile xref:manual/plugins.adoc[Log4j plugins]. -See -xref:manual/appenders/database.adoc#MongoDb4Provider[MongoDb4 provider] -for more information. +See xref:manual/extending.adoc[Extending Log4j] for more details. + +include::partial$components/log4j-plugin-processor.adoc[] + +[#log4j-plugins] +== `log4j-plugins` + +|=== +| JPMS module +| `org.apache.logging.log4j.plugins` +|=== + +The `log4j-plugins` artifact contains a small Dependency Injection framework used by +<<log4j-core,Log4j Core 3>>. -include::partial$components/log4j-mongodb4.adoc[] +See xref:manual/architecture.adoc[] for more details. + +include::partial$components/log4j-plugins.adoc[] + +[#log4j-script] +== `log4j-script` + +|=== +| JPMS module +| `org.apache.logging.log4j.script` +|=== + +The `log4j-script` artifact enables JSR 223 support in many Log4j components. +It is required by: + +* xref:manual/filters.adoc#ScriptFilter[Script Filter], +* scripting support for the xref:manual/appenders/delegating.adoc#RoutingAppender[Routing Appender], +* scripting support for the xref:manual/appenders/rolling-file.adoc[rolling file appenders]. + +See xref:manual/scripts.adoc[] for more details. + +include::partial$components/log4j-script.adoc[] [#log4j-slf4j2-impl] == `log4j-slf4j2-impl` @@ -450,34 +431,6 @@ Don't deploy this artifact together with either <<log4j-slf4j2-impl>> or <<log4j include::partial$components/log4j-slf4j-impl.adoc[] -[#log4j-spring-boot] -== `log4j-spring-boot` - -[cols="1h,5"] -|=== -| JPMS module -| `org.apache.logging.log4j.spring.boot` -|=== - -The `log4j-spring-boot` artifact contains multiple utils to integrate with -https://spring.io/projects/spring-framework[Spring Framework 5.x] -or earlier versions and -https://spring.io/projects/spring-boot[Spring Boot 2.x] -or earlier versions. - -* It provides a xref:manual/systemproperties.adoc#property-sources[property source]. -See xref:manual/systemproperties.adoc#SpringPropertySource[Spring Property source] for more details. -* It provides a xref:manual/lookups.adoc[lookup]. -See xref:manual/lookups.adoc#SpringBootLookup[Spring lookup] for more details. -* It provides an xref:manual/configuration.adoc#arbiters[arbiter]. -See xref:log4j-spring-boot.adoc[Spring arbiter] for more details. -* It provides an alternative -https://docs.spring.io/spring-boot/api/java/org/springframework/boot/logging/LoggingSystem.html[`LoggingSystem`] -implementation. -See xref:log4j-spring-boot.adoc[] for more details. - -include::partial$components/log4j-spring-boot.adoc[] - [#log4j-spring-cloud-config-client] == `log4j-spring-cloud-config-client` @@ -491,27 +444,10 @@ The `log4j-spring-cloud-config-client` provides utils to integrate with https://spring.io/projects/spring-cloud-config[Spring Cloud Config 3.x] or earlier versions. -See xref:log4j-spring-cloud-config.adoc[] for more details. +See xref:log4j-spring-cloud-config-client.adoc[] for more details. include::partial$components/log4j-spring-cloud-config-client.adoc[] -[#log4j-taglib] -== `log4j-taglib` - -[cols="1h,5"] -|=== -| JPMS module -| `org.apache.logging.log4j.taglib` -|=== - -The `log4j-taglib` provides a -https://jakarta.ee/specifications/pages/2.3/[Jakarta Servlet Pages 2.3] -or earlier library that logs to the xref:manual/api.adoc[]. - -See xref:jakarta.adoc#log4j-taglib[Log4j Taglib] for more details. - -include::partial$components/log4j-taglib.adoc[] - [#log4j-to-jul] == `log4j-to-jul` @@ -555,31 +491,3 @@ Don't deploy this artifact together with either <<log4j-slf4j-impl>> or <<log4j- ==== include::partial$components/log4j-to-slf4j.adoc[] - -[#log4j-web] -== `log4j-web` - -|=== -| JPMS module -| `org.apache.logging.log4j.web` -|=== - -The `log4j-jakarta-web` contains multiple utils to run your applications in a -https://jakarta.ee/specifications/servlet/5.0/[Jakarta Servlet 4.0] -or Java EE Servlet environment: - -* It synchronizes the lifecycle of Log4j Core and your application. -See xref:jakarta.adoc#log4j-jakarta-web[Integrating with web applications] for more details. - -* It contains a lookup for the data contained in a Servlet context. -See xref:manual/lookups.adoc#WebLookup[Web Lookup] for more details. - -* It contains an xref:manual/appenders.adoc[appender] to forward log event to a Servlet. -See xref:manual/appenders.adoc#ServletAppender[Servlet Appender] for more details. - -[IMPORTANT] -==== -Don't deploy this artifact together with <<log4j-jakarta-web>>. -==== - -include::partial$components/log4j-web.adoc[] \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/pages/manual/appenders.adoc b/src/site/antora/modules/ROOT/pages/manual/appenders.adoc index 84df9ca019..a25db96530 100644 --- a/src/site/antora/modules/ROOT/pages/manual/appenders.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/appenders.adoc @@ -590,7 +590,7 @@ this usually results in the stacktrace being printed to the log file twice. Additional runtime dependencies are required for using the servlet appender: -include::partial$manual/dependencies-log4j-jakarta-web.adoc[] +include::partial$features/servlet-support.adoc[] See xref:jakarta.adoc[] for more information. diff --git a/src/site/antora/modules/ROOT/pages/manual/appenders/database.adoc b/src/site/antora/modules/ROOT/pages/manual/appenders/database.adoc index 101a575857..43b692bdc1 100644 --- a/src/site/antora/modules/ROOT/pages/manual/appenders/database.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/appenders/database.adoc @@ -315,7 +315,7 @@ xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-loggin Additional runtime dependencies are required to use the JDBC Appender: -include::partial$manual/dependencies-log4j-jdbc.adoc[] +include::partial$components/log4j-jdbc.adoc[] [#ConnectionSource] === Connection Sources @@ -362,7 +362,7 @@ Only the `java:` JNDI protocol is supported. Additional runtime dependencies are required to use `DataSource`: -include::partial$manual/dependencies-log4j-jndi.adoc[] +include::partial$components/log4j-jndi.adoc[] xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-db-jdbc-DataSourceConnectionSource[{plugin-reference-marker} Plugin reference for `DataSource`] diff --git a/src/site/antora/modules/ROOT/pages/manual/appenders/delegating.adoc b/src/site/antora/modules/ROOT/pages/manual/appenders/delegating.adoc index 9a1b0112c0..a717e5c6ce 100644 --- a/src/site/antora/modules/ROOT/pages/manual/appenders/delegating.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/appenders/delegating.adoc @@ -294,13 +294,16 @@ xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-loggin [#JCToolsBlockingQueueFactory] `JCToolsBlockingQueue`:: + ++ This queue factory uses https://jctools.github.io/JCTools/[JCTools], specifically the MPSC bounded lock-free queue. + .Additional dependencies are required to use `JCToolsBlockingQueue` [%collapsible] ===== -include::partial$manual/dependencies-log4j-jctools.adoc[] + +include::partial$features/queue-jctools.adoc[] + ===== xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-async-JCToolsBlockingQueueFactory[{plugin-reference-marker} Plugin reference for `JCToolsBlockingQueue`] @@ -1097,6 +1100,13 @@ include::example$manual/appenders/delegating/routing-definition.properties[tag=a [#RoutingAppender-example-script] ==== Using scripts +[WARNING] +===== +Additional runtime dependencies are required to use scripts: + +include::partial$components/log4j-script.adoc[] +===== + If the flexibility of xref:manual/lookups.adoc[] is not enough to express your routing logic, you can also resort to scripts. In the example below, we route messages in a round-robin fashion to three different Syslog servers: diff --git a/src/site/antora/modules/ROOT/pages/manual/appenders/message-queue.adoc b/src/site/antora/modules/ROOT/pages/manual/appenders/message-queue.adoc index f67c86c4da..274172a37a 100644 --- a/src/site/antora/modules/ROOT/pages/manual/appenders/message-queue.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/appenders/message-queue.adoc @@ -628,7 +628,7 @@ See <<JmsAppender-mapping>> below for more information. Additional runtime dependencies are required to use the JMS Appender: -include::partial$manual/dependencies-log4j-jakarta-jms.adoc[] +include::partial$features/appender-jms.adoc[] xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-mom-JmsAppender[{plugin-reference-marker} Plugin reference for `JMS`] diff --git a/src/site/antora/modules/ROOT/pages/manual/appenders/network.adoc b/src/site/antora/modules/ROOT/pages/manual/appenders/network.adoc index edb70569f5..c3d9645ea1 100644 --- a/src/site/antora/modules/ROOT/pages/manual/appenders/network.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/appenders/network.adoc @@ -628,7 +628,7 @@ See <<tls-configuration>> for more details. Additional runtime dependencies are required to use the SMTP appender: -include::partial$manual/dependencies-log4j-jakarta-stmp.adoc[] +include::partial$features/appender-smtp.adoc[] xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-appender-SmtpAppender[{plugin-reference-marker} Plugin reference for `SMTP`] diff --git a/src/site/antora/modules/ROOT/pages/manual/appenders/rolling-file.adoc b/src/site/antora/modules/ROOT/pages/manual/appenders/rolling-file.adoc index 031c235a65..84a40f21da 100644 --- a/src/site/antora/modules/ROOT/pages/manual/appenders/rolling-file.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/appenders/rolling-file.adoc @@ -1443,6 +1443,12 @@ xref:manual/scripts.adoc#ScriptRef[`ScriptRef`] See xref:manual/scripts.adoc[Scripts] for more details about scripting. |=== +.Additional runtime dependencies are required to use `ScriptCondition` +[%collapsible] +===== +include::partial$components/log4j-script.adoc[] +===== + The script must return a list of link:../../javadoc/log4j-core/org/apache/logging/log4j/core/appender/rolling/action/PathWithAttributes.html[`PathWithAttributes`] objects and supports the following bindings: diff --git a/src/site/antora/modules/ROOT/pages/manual/async.adoc b/src/site/antora/modules/ROOT/pages/manual/async.adoc index 407fa868b3..4814d90b70 100644 --- a/src/site/antora/modules/ROOT/pages/manual/async.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/async.adoc @@ -48,7 +48,7 @@ include::partial$manual/async-trade-offs.adoc[leveloffset=+1] In order to use async loggers, you need to add `log4j-async-logger` to you application's dependencies, by adding the following dependency to your build tool: -include::partial$manual/dependencies-log4j-async-logger.adoc[] +include::partial$features/async-logger.adoc[] [#configuration] == Configuration diff --git a/src/site/antora/modules/ROOT/pages/manual/configuration.adoc b/src/site/antora/modules/ROOT/pages/manual/configuration.adoc index 275537024f..66f1c0ad8f 100644 --- a/src/site/antora/modules/ROOT/pages/manual/configuration.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/configuration.adoc @@ -55,7 +55,7 @@ xref:manual/systemproperties.adoc#log4j.configuration.level[`log4j.configuration to the console. You can override the location of the configuration file -using the xref:manual/systemproperties.adoc#log4j2.configurationFile[`log4j2.configurationFile` +using the xref:manual/systemproperties.adoc#log4j.configuration.location[`log4j.configuration.location` system property]. In such a case, Log4j Core will guess the configuration file format from the provided file name, or use the default configuration factory if the extension is unknown. @@ -71,7 +71,8 @@ That is, don't provide both `log4j2.xml` and `log4j2.json` files. === Predefined ``ConfigurationFactory`` plugins Log4j Core uses plugins extending from link:../javadoc/log4j-core/org/apache/logging/log4j/core/config/ConfigurationFactory.html[`ConfigurationFactory`] to determine which configuration file extensions are supported, in which order, and how to read them. -How this works under the hood and how you can introduce your custom implementations is explained in <<ConfigurationFactory>>. +How this works under the hood and how you can introduce your custom implementations is explained in +xref:manual/extending.adoc#ConfigurationFactory[`ConfigurationFactory`]. .Supported configuration file formats by predefined `ConfigurationFactory` plugins [%header,cols="1,1m,1"] @@ -238,7 +239,7 @@ for more details. Log4j Core's logging pipeline is quite complex (see xref:manual/architecture.adoc[Architecture]), but most users only require these elements: Loggers:: -xref:manual/api.adoc#loggers[Loggers] are the entry point of the logging pipeline, which is directly used in the code. +{log4j2-url}manual/api.adoc#loggers[Loggers] are the entry point of the logging pipeline, which is directly used in the code. Their configuration must specify which level of messages they log and to which appenders they send the messages. We will cover them while <<configuring-loggers, configuring loggers>>. diff --git a/src/site/antora/modules/ROOT/pages/manual/filters.adoc b/src/site/antora/modules/ROOT/pages/manual/filters.adoc index 2789db63c5..e2101a48d7 100644 --- a/src/site/antora/modules/ROOT/pages/manual/filters.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/filters.adoc @@ -1277,7 +1277,7 @@ It does not support **any** configuration attribute, even the common configurati xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-DenyAllFilter[📖 Plugin reference for `DenyAllFilter`] -[#Script] +[#ScriptFilter] ==== `ScriptFilter` The `ScriptFilter` executes a script that must return `true` if the event matches and `false` otherwise. @@ -1301,6 +1301,12 @@ xref:manual/scripts.adoc#ScriptRef[`ScriptRef`] See xref:manual/scripts.adoc[Scripts] for more details about scripting. |=== +.Additional runtime dependencies are required to use `ScripFilter` +[%collapsible] +===== +include::partial$components/log4j-script.adoc[] +===== + The bindings available to the script depend on whether the `ScriptFilter` is used as a global filter in the <<logger-stage,Logger stage>> or in the remaining stages. For global filters, the following bindings are available: @@ -1366,6 +1372,8 @@ For the remaining filters, only these bindings are available: |=== +xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-ScriptFilter[📖 Plugin reference for `ScriptFilter`] + As an example, if you wish to match only log events that contain a certain exception, you can use a simple Groovy script: @@ -1459,8 +1467,6 @@ include::example$manual/filters/ScriptFilter.properties[tag=global] ---- ==== -xref:plugin-reference.adoc#org-apache-logging-log4j_log4j-core_org-apache-logging-log4j-core-filter-ScriptFilter[📖 Plugin reference for `ScriptFilter`] - [#extending] == Extending diff --git a/src/site/antora/modules/ROOT/pages/manual/garbagefree.adoc b/src/site/antora/modules/ROOT/pages/manual/garbagefree.adoc index a18ebba3f2..00c02ab754 100644 --- a/src/site/antora/modules/ROOT/pages/manual/garbagefree.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/garbagefree.adoc @@ -241,7 +241,7 @@ There are certain caveats associated with the configuration of garbage-free logg [#core-limitation-properties] Property substitutions:: -Some xref:manual/configuration.adoc#PropertySubstitution[property substitutions] (e.g., ones using xref:manual/lookups.adoc#DateLookup[Date Lookup]) might result in temporary objects being created during steady-state logging. +Some xref:manual/configuration.adoc#property-substitution[property substitutions] (e.g., ones using xref:manual/lookups.adoc#DateLookup[Date Lookup]) might result in temporary objects being created during steady-state logging. [#core-limitation-async-logger-wait-strategy] Asynchronous logger wait strategies:: diff --git a/src/site/antora/modules/ROOT/pages/manual/installation.adoc b/src/site/antora/modules/ROOT/pages/manual/installation.adoc index c999a33046..719e097fb2 100644 --- a/src/site/antora/modules/ROOT/pages/manual/installation.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/installation.adoc @@ -123,7 +123,7 @@ repositories { The easiest way to install Log4j API is through a dependency management tool such as Maven or Gradle, by adding the following dependency: -include::partial$components/log4j-api.adoc[] +include::partial$features/api.adoc[] [#impl] == Installing a logging implementation @@ -262,7 +262,7 @@ to the JVM parameters in your application launcher. You can translate {jpl-link} calls to Log4j API using the `log4j-jpl` artifact: -include::partial$components/log4j-jpa.adoc[] +include::partial$components/log4j-jpl.adoc[] [#impl-core-bridge-jcl] ===== Installing JCL-to-Log4j bridge @@ -293,14 +293,6 @@ Gradle:: Gradle users should refer to the https://docs.gradle.org/current/userguide/platforms.html#sub:using-platform-to-control-transitive-deps[Using a platform to control transitive versions] of the Gradle documentation. ==== -.Are you using Commons Logging 1.2.0 or earlier? -[%collapsible] -===== -You need to install the following dependency instead: - -include::partial$components/log4j-jcl.adoc[] -===== - [#impl-core-bridge-jboss-logging] ===== Installing JBoss Logging-to-Log4j bridge diff --git a/src/site/antora/modules/ROOT/pages/manual/jmx.adoc b/src/site/antora/modules/ROOT/pages/manual/jmx.adoc deleted file mode 100644 index 9d604dc1b6..0000000000 --- a/src/site/antora/modules/ROOT/pages/manual/jmx.adoc +++ /dev/null @@ -1,108 +0,0 @@ -//// - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -//// -= JMX - -Log4j has built-in support for JMX. - -When JMX support is enabled, the StatusLogger, ContextSelector, and all LoggerContexts, LoggerConfigs, and Appenders are instrumented with MBeans. - -Also included is a simple client GUI that can be used to monitor the -StatusLogger output, as well as to remotely reconfigure Log4j with a -different configuration file, or to edit the current configuration -directly. - -[#Enabling_JMX] -== Enabling JMX - -JMX support is disabled by default. - -NOTE: JMX support was enabled by default in Log4j versions before `2.24.0`. - -To enable JMX support, set the -xref:manual/systemproperties.adoc#log4j2.disableJmx[`log4j2.disableJmx`] -system property when starting the Java VM: - -`log4j2.disableJmx=false` - -[#Local] -== Local Monitoring and Management - -To perform local monitoring you need to set the -xref:manual/systemproperties.adoc#log4j2.disableJmx[`log4j2.disableJmx`] -system property to `false`. -The JConsole tool that is included in the Java JDK can be -used to monitor your application. Start JConsole by typing -`$JAVA_HOME/bin/jconsole` in a command shell. For more details, -see Oracle's documentation at -https://docs.oracle.com/javase/7/docs/technotes/guides/management/jconsole.html[how -to use JConsole]. - -[#Remote] -== Remote Monitoring and Management - -To enable monitoring and management from remote systems, set the -following two system properties when starting the Java VM: - -`log4j2.disableJmx=false` - -and - -`com.sun.management.jmxremote.port=portNum` - -In the property above, `portNum` is the port number through which you -want to enable JMX RMI connections. - -For more details, see Oracle's documentation at -https://docs.oracle.com/javase/7/docs/technotes/guides/management/agent.html#gdenl[Remote -Monitoring and Management]. - -[#RMI_GC] -== RMI impact on Garbage Collection - -Be aware that RMI by default triggers a full GC every hour. See the -https://docs.oracle.com/javase/7/docs/technotes/guides/rmi/sunrmiproperties.html[Oracle -documentation] for the `sun.rmi.dgc.server.gcInterval` and -`sun.rmi.dgc.client.gcInterval` properties. The default value of both -properties is 3600000 milliseconds (one hour). Before Java 6, it was one -minute. - -The two `sun.rmi` arguments reflect whether your JVM is running in server -or client mode. If you want to modify the GC interval time it may be -best to specify both properties to ensure the argument is picked up by -the JVM. - -An alternative may be to disable explicit calls to `System.gc()` -altogether with `-XX:+DisableExplicitGC`, or (if you are using the CMS -or G1 collector) add `-XX:+ExplicitGCInvokesConcurrent` to ensure the -full GCs are done concurrently in parallel with your application instead -of forcing a stop-the-world collection. - -[#Log4j_MBeans] -== Log4j Instrumented Components - -The best way to find out which methods and attributes of the various Log4j components are accessible via JMX is to look at the `org.apache.logging.log4j.core.jmx` package contents in the `log4j-core` artifact or by exploring directly in JConsole. - -The screenshot below shows the Log4j MBeans in JConsole. - -image:jmx-jconsole-mbeans.png[JConsole screenshot of the -MBeans tab] - -[#ClientGUI] -== Client GUI - -https://github.com/apache/logging-log4j-jmx-gui[The Apache Log4j JMX GUI] is a basic client GUI that can be used to monitor the `StatusLogger` output and to remotely modify the Log4j configuration. -The client GUI can be run as a stand-alone application or as a JConsole plug-in. diff --git a/src/site/antora/modules/ROOT/pages/manual/layouts.adoc b/src/site/antora/modules/ROOT/pages/manual/layouts.adoc index 4ee5dfbc97..81ca4e3fb7 100644 --- a/src/site/antora/modules/ROOT/pages/manual/layouts.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/layouts.adoc @@ -205,27 +205,7 @@ Both `CsvParameterLayout` and `CsvLogEventLayout` are configured with the follow Additional runtime dependencies are required for using CSV layouts: -[tabs] -==== -Maven:: -+ -[source,xml,subs="+attributes"] ----- -<dependency> - <groupId>org.apache.commons</groupId> - <artifactId>commons-csv</artifactId> - <version>{commons-csv-version}</version> - <scope>runtime</scope> -</dependency> ----- - -Gradle:: -+ -[source,groovy,subs="+attributes"] ----- -runtimeOnly 'org.apache.commons:commons-csv:{commons-csv-version}' ----- -==== +include::partial$features/layout-csv.adoc[] [#HTMLLayout] === HTML Layout diff --git a/src/site/antora/modules/ROOT/pages/manual/lookups.adoc b/src/site/antora/modules/ROOT/pages/manual/lookups.adoc index 1a939e452b..5a1411ef04 100644 --- a/src/site/antora/modules/ROOT/pages/manual/lookups.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/lookups.adoc @@ -544,7 +544,7 @@ Android does not support JNDI. Additional runtime dependencies are required for using JNDI Lookup: -include::partial$manual/dependencies-log4j-jndi.adoc[] +include::partial$components/log4j-jndi.adoc[] [#Log4jLookup] === Configuration Location Lookup @@ -940,7 +940,7 @@ Using the Web Lookup, you can, for example, place the log file in the applicatio Additional runtime dependencies are required for using web lookup: -include::partial$manual/dependencies-log4j-jakarta-web.adoc[] +include::partial$features/servlet-support.adoc[] [#third-party] == Third-party lookups diff --git a/src/site/antora/modules/ROOT/pages/manual/migration.adoc b/src/site/antora/modules/ROOT/pages/manual/migration.adoc index 938a0e662d..5534f6d374 100644 --- a/src/site/antora/modules/ROOT/pages/manual/migration.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/migration.adoc @@ -53,11 +53,11 @@ The following `log4j-core` features were moved to their own modules or were remo |=== | Log4j 2 feature | Log4j 3 module -| xref:manual/appenders.adoc#BlockingQueueFactory[Asynchronous appender: JCTools-based queue] -| {sonatype-url}/log4j-jctools[`log4j-jctools`] +| xref:manual/appenders/delegating.adoc#BlockingQueueFactory[Asynchronous appender: JCTools-based queue] +| xref:components.adoc#log4j-jctools[`log4j-jctools`] | xref:manual/async.adoc[Asynchronous logger] -| {sonatype-url}/log4j-async-logger[`log4j-async-logger`] +| xref:components.adoc#log4j-async-logger[`log4j-async-logger`] | {log4j2-url}/manual/appenders.html#CassandraAppender[Cassandra appender] | _removed without replacement_ @@ -67,13 +67,13 @@ footnote:removal[If you are using these components, and you can help us to maint | _removed without replacement_ footnote:removal[] | xref:manual/configuration.adoc#configuration-with-properties[Configuration file: Java properties format] -| {sonatype-url}/log4j-config-properties[`log4j-config-properties`] +| xref:components.adoc#log4j-config-properties[`log4j-config-properties`] | xref:manual/configuration.adoc#configuration-with-yaml[Configuration file: YAML format] -| {sonatype-url}/log4j-config-yaml[`log4j-config-yaml`] +| xref:components.adoc#log4j-config-yaml[`log4j-config-yaml`] | xref:manual/layouts.adoc#CSVLayouts[CSV layouts] -| {sonatype-url}/log4j-csv[`log4j-csv`] +| xref:components.adoc#log4j-csv[`log4j-csv`] | {log4j2-url}/manual/layouts.html#GELFLayout[GELF layout] | replaced by @@ -82,14 +82,14 @@ and the included xref:manual/json-template-layout.adoc#event-templates[`GelfLayout.json`] template -| xref:manual/appenders.adoc#JDBCAppender[JDBC appender] -| {sonatype-url}/log4j-jdbc[`log4j-jdbc`] +| xref:manual/appenders/database.adoc#JdbcAppender[JDBC appender] +| xref:components.adoc#log4j-jdbc[`log4j-jdbc`] -| xref:manual/appenders.adoc#JDBCPoolingDriver[JDBC appender: DBCP 2 connection source] -| {sonatype-url}/log4j-jdbc-dbcp2[`log4j-jdbc-dbcp2`] +| xref:manual/appenders/database.adoc#PoolingDriverConnectionSource[JDBC appender: DBCP 2 connection source] +| xref:components.adoc#log4j-jdbc-dbcp2[`log4j-jdbc-dbcp2`] -| xref:manual/appenders.adoc#JDBCDataSource[JDBC appender: JNDI connection source] -| {sonatype-url}/log4j-jndi[`log4j-jndi`] +| xref:manual/appenders/database.adoc#DataSourceConnectionSource[JDBC appender: JNDI connection source] +| xref:components.adoc#log4j-jndi[`log4j-jndi`] | {log4j2-url}/manual/appenders.html#JeroMQAppender[JeroMQ appender] | replaced by external @@ -100,7 +100,7 @@ module | _removed without replacement_ footnote:removal[] | xref:manual/lookups.adoc#JndiLookup[JNDI lookup] -| {sonatype-url}/log4j-jndi[`log4j-jndi`] +| xref:components.adoc#log4j-jndi[`log4j-jndi`] | {log4j2-url}/manual/appenders.html#JPAAppender[JPA appender] | _removed without replacement_ footnote:removal[] @@ -117,7 +117,7 @@ https://github.com/fabric8io/kubernetes-client/blob/main/doc/KubernetesLog4j.md[ module | xref:manual/scripts.adoc[Scripting support] -| {sonatype-url}/log4j-script[`log4j-script`] +| xref:components.adoc#log4j-script[`log4j-script`] | {log4j2-url}/manual/webapp.html[Servlet application support: Java EE version] | _removed without replacement_ footnote:removal[] diff --git a/src/site/antora/modules/ROOT/pages/manual/pattern-layout.adoc b/src/site/antora/modules/ROOT/pages/manual/pattern-layout.adoc index 17d3f2d673..9e9b505502 100644 --- a/src/site/antora/modules/ROOT/pages/manual/pattern-layout.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/pattern-layout.adoc @@ -490,7 +490,7 @@ https://docs.oracle.com/en/java/javase/{java-target-version}/docs/api/java.base/ formats are supported. Only timestamps in the formats mentioned in the table above may use the _nano-of-second_ pattern letter `n` instead of the _fraction-of-second_ pattern letter `S`. -Users may revert to a millisecond-precision clock when running on Java 9 by setting xref:manual/systemproperties.adoc#log4j2.clock[the `log4j2.clock` system property] to `SystemMillisClock`. +Users may revert to a millisecond-precision clock when running on Java 9 by setting xref:manual/systemproperties.adoc#log4j.configuration.clock[the `log4j.configuration.clock` system property] to `SystemMillisClock`. [WARNING] ==== @@ -1344,7 +1344,7 @@ uuid{RANDOM|TIME} The time-based UUID is a Type 1 UUID generated using the MAC address of each host To ensure uniqueness across multiple JVMs and/or class loaders on the same host, a random number between 0 and 16,384 will be associated with each instance of the UUID generator class, and included in each time-based UUID generated. -See also xref:manual/systemproperties.adoc#log4j2.uuidSequence[`log4j2.uuidSequence`]. +See also xref:manual/systemproperties.adoc#log4j.uuid.sequence[`log4j.uuid.sequence`]. Because time-based UUIDs contain the MAC address and timestamp, they should be used with care. [#format-modifiers] @@ -1583,7 +1583,7 @@ If your terminal supports 24-bit colors, you can specify: ANSI escape sequences are supported natively on many platforms, but not by default on Windows. To enable ANSI support add the http://fusesource.github.io/jansi/[Jansi] -dependency to your application, and set xref:manual/systemproperties.adoc#log4j2.skipJansi[the `log4j2.skipJansi` system property] to `false`. +dependency to your application, and set xref:manual/systemproperties.adoc#log4j.console.jansiEnabled[the `log4j.console.jansiEnabled` system property] to `true`. This allows Log4j to use Jansi to add ANSI escape codes when writing to the console. [NOTE] @@ -1685,7 +1685,7 @@ Format modifiers to control such things as field width, padding, left, and right |<<converter-thread-priority,%tp>> | -|<<converter-thread-context-map[%X{key,,key2...\>>} + +|<<converter-thread-context-map,%X{key,,key2...\>>} + %mdc{key[,key2...\]} + %MDC{key[,key2...\]}] | @@ -1789,4 +1789,4 @@ To get the most out of it, mind the following checklist: * Enable xref:manual/garbagefree.adoc[garbage-free logging] * Mind <<garbage-free,the garbage footprint of features you use>> -* Don't give too much slack to xref:manual/systemproperties.adoc#log4j2.layoutStringBuilderMaxSize[`log4j2.layoutStringBuilderMaxSize`] and try to keep it relatively tight +* Don't give too much slack to xref:manual/systemproperties.adoc#log4j.gc.layoutStringBuilderMaxSize[`log4j.gc.layoutStringBuilderMaxSize`] and try to keep it relatively tight diff --git a/src/site/antora/modules/ROOT/pages/manual/scripts.adoc b/src/site/antora/modules/ROOT/pages/manual/scripts.adoc index 99b81bdc51..0635a9428f 100644 --- a/src/site/antora/modules/ROOT/pages/manual/scripts.adoc +++ b/src/site/antora/modules/ROOT/pages/manual/scripts.adoc @@ -23,11 +23,15 @@ https://docs.oracle.com/en/java/javase/11/scripting/scripting-languages-and-java scripting languages to be used in some of its components. [WARNING] -==== +===== +Additional runtime dependencies are required to enable JSR 223 scripting: + +include::partial$components/log4j-script.adoc[] + In order to enable a scripting language, its name must be included in the xref:manual/systemproperties.adoc#log4j.script.enableLanguages[`log4j.script.enableLanguages`] configuration property. -==== +===== Each component that allows scripts can contain on of the following configuration elements: diff --git a/src/site/antora/modules/ROOT/pages/migrate-from-logback.adoc b/src/site/antora/modules/ROOT/pages/migrate-from-logback.adoc index bb03e2c77a..15ad73eff0 100644 --- a/src/site/antora/modules/ROOT/pages/migrate-from-logback.adoc +++ b/src/site/antora/modules/ROOT/pages/migrate-from-logback.adoc @@ -162,7 +162,9 @@ java.lang.RuntimeException: Message [TIP] ==== As a temporary solution, the SLF4J-to-Log4j API bridges contain a special -xref:manual/api.adoc#logger-message-factories[`MessageFactory`] +{log4j2-url}/manual/api.html#logger-message-factories[`MessageFactory`] that classifies trailing `Throwable` arguments in the same way Logback does. -To use it, you need to set the xref:manual/systemproperties.adoc#log4j2.messageFactory[`log4j2.messageFactory`] configuration property to `org.apache.logging.slf4j.message.ThrowableConsumingMessageFactory`. +To use it, you need to set the +{log4j2-url}/manual/systemproperties.html#log4j2.messageFactory[`log4j2.messageFactory`] +configuration property to `org.apache.logging.slf4j.message.ThrowableConsumingMessageFactory`. ==== diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-api-test.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-api-test.adoc deleted file mode 100644 index 4f3b5bc964..0000000000 --- a/src/site/antora/modules/ROOT/partials/components/log4j-api-test.adoc +++ /dev/null @@ -1,41 +0,0 @@ -//// - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -//// - -[tabs] -==== -Maven:: -+ -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. -+ -[source,xml,subs="+attributes"] ----- -<dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-api-test</artifactId> - <scope>runtime</scope> -</dependency> ----- - -Gradle:: -+ -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. -+ -[source,groovy,subs="+attributes"] ----- -runtimeOnly 'org.apache.logging.log4j:log4j-api-test' ----- -==== \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-appserver.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-appserver.adoc deleted file mode 100644 index 0ae67a47ad..0000000000 --- a/src/site/antora/modules/ROOT/partials/components/log4j-appserver.adoc +++ /dev/null @@ -1,41 +0,0 @@ -//// - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -//// - -[tabs] -==== -Maven:: -+ -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. -+ -[source,xml,subs="+attributes"] ----- -<dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-appserver</artifactId> - <scope>runtime</scope> -</dependency> ----- - -Gradle:: -+ -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. -+ -[source,groovy,subs="+attributes"] ----- -runtimeOnly 'org.apache.logging.log4j:log4j-appserver' ----- -==== \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-async-logger.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-async-logger.adoc similarity index 83% rename from src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-async-logger.adoc rename to src/site/antora/modules/ROOT/partials/components/log4j-async-logger.adoc index a82e45efe2..ce3d741464 100644 --- a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-async-logger.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-async-logger.adoc @@ -15,15 +15,14 @@ limitations under the License. //// -// This file contains the dependencies required to enable Asynchronous Loggers. - [tabs] ==== Maven:: + +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. ++ [source,xml] ---- -<!-- We assume you use `log4j-bom` for dependency management --> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-async-logger</artifactId> @@ -33,9 +32,10 @@ Maven:: Gradle:: + +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. ++ [source,groovy] ---- -// We assume you use `log4j-bom` for dependency management runtimeOnly 'org.apache.logging.log4j:log4j-async-logger' ---- -==== +==== \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-cassandra.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-cassandra.adoc deleted file mode 100644 index ff2fe7496c..0000000000 --- a/src/site/antora/modules/ROOT/partials/components/log4j-cassandra.adoc +++ /dev/null @@ -1,41 +0,0 @@ -//// - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -//// - -[tabs] -==== -Maven:: -+ -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. -+ -[source,xml,subs="+attributes"] ----- -<dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-cassandra</artifactId> - <scope>runtime</scope> -</dependency> ----- - -Gradle:: -+ -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. -+ -[source,groovy,subs="+attributes"] ----- -runtimeOnly 'org.apache.logging.log4j:log4j-cassandra' ----- -==== \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-1.2-api.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-config-jackson.adoc similarity index 90% copy from src/site/antora/modules/ROOT/partials/components/log4j-1.2-api.adoc copy to src/site/antora/modules/ROOT/partials/components/log4j-config-jackson.adoc index d71c9ab4e5..3c85428100 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-1.2-api.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-config-jackson.adoc @@ -25,8 +25,7 @@ We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency man ---- <dependency> <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-1.2-api</artifactId> - <scope>runtime</scope> + <artifactId>log4j-config-jackson</artifactId> </dependency> ---- @@ -36,6 +35,6 @@ We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency man + [source,groovy] ---- -runtimeOnly 'org.apache.logging.log4j:log4j-1.2-api' +api 'org.apache.logging.log4j:log4j-config-jackson' ---- ==== \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-1.2-api.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-config-properties.adoc similarity index 90% copy from src/site/antora/modules/ROOT/partials/components/log4j-1.2-api.adoc copy to src/site/antora/modules/ROOT/partials/components/log4j-config-properties.adoc index d71c9ab4e5..5161ade794 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-1.2-api.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-config-properties.adoc @@ -25,7 +25,7 @@ We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency man ---- <dependency> <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-1.2-api</artifactId> + <artifactId>log4j-config-properties</artifactId> <scope>runtime</scope> </dependency> ---- @@ -36,6 +36,6 @@ We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency man + [source,groovy] ---- -runtimeOnly 'org.apache.logging.log4j:log4j-1.2-api' +runtimeOnly 'org.apache.logging.log4j:log4j-config-properties' ---- ==== \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-1.2-api.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-config-yaml.adoc similarity index 91% copy from src/site/antora/modules/ROOT/partials/components/log4j-1.2-api.adoc copy to src/site/antora/modules/ROOT/partials/components/log4j-config-yaml.adoc index d71c9ab4e5..c0bc150f10 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-1.2-api.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-config-yaml.adoc @@ -25,7 +25,7 @@ We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency man ---- <dependency> <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-1.2-api</artifactId> + <artifactId>log4j-config-yaml</artifactId> <scope>runtime</scope> </dependency> ---- @@ -36,6 +36,6 @@ We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency man + [source,groovy] ---- -runtimeOnly 'org.apache.logging.log4j:log4j-1.2-api' +runtimeOnly 'org.apache.logging.log4j:log4j-config-yaml' ---- ==== \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-core-test.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-core-test.adoc index d41f2d35ff..9376ea7fd4 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-core-test.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-core-test.adoc @@ -19,9 +19,9 @@ ==== Maven:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + -[source,xml,subs="+attributes"] +[source,xml] ---- <dependency> <groupId>org.apache.logging.log4j</groupId> @@ -32,9 +32,9 @@ We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency mana Gradle:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + -[source,groovy,subs="+attributes"] +[source,groovy] ---- runtimeOnly 'org.apache.logging.log4j:log4j-core-test' ---- diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-core.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-core.adoc index 592679ed00..207624163e 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-core.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-core.adoc @@ -19,9 +19,9 @@ ==== Maven:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + -[source,xml,subs="+attributes"] +[source,xml] ---- <dependency> <groupId>org.apache.logging.log4j</groupId> @@ -32,9 +32,9 @@ We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency mana Gradle:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + -[source,groovy,subs="+attributes"] +[source,groovy] ---- runtimeOnly 'org.apache.logging.log4j:log4j-core' ---- diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-couchdb.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-couchdb.adoc deleted file mode 100644 index c72e0af4c4..0000000000 --- a/src/site/antora/modules/ROOT/partials/components/log4j-couchdb.adoc +++ /dev/null @@ -1,41 +0,0 @@ -//// - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -//// - -[tabs] -==== -Maven:: -+ -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. -+ -[source,xml,subs="+attributes"] ----- -<dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-couchdb</artifactId> - <scope>runtime</scope> -</dependency> ----- - -Gradle:: -+ -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. -+ -[source,groovy,subs="+attributes"] ----- -runtimeOnly 'org.apache.logging.log4j:log4j-couchdb' ----- -==== \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-1.2-api.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-csv.adoc similarity index 92% copy from src/site/antora/modules/ROOT/partials/components/log4j-1.2-api.adoc copy to src/site/antora/modules/ROOT/partials/components/log4j-csv.adoc index d71c9ab4e5..18d3a5be06 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-1.2-api.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-csv.adoc @@ -25,7 +25,7 @@ We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency man ---- <dependency> <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-1.2-api</artifactId> + <artifactId>log4j-csv</artifactId> <scope>runtime</scope> </dependency> ---- @@ -36,6 +36,6 @@ We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency man + [source,groovy] ---- -runtimeOnly 'org.apache.logging.log4j:log4j-1.2-api' +runtimeOnly 'org.apache.logging.log4j:log4j-csv' ---- ==== \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-docker.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-docker.adoc index 1b65df3861..069ae7fe67 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-docker.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-docker.adoc @@ -19,24 +19,23 @@ ==== Maven:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + -[source,xml,subs="+attributes"] +[source,xml] ---- <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-docker</artifactId> - <version>{log4j-core-version}</version> <scope>runtime</scope> </dependency> ---- Gradle:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + -[source,groovy,subs="+attributes"] +[source,groovy] ---- -runtimeOnly 'org.apache.logging.log4j:log4j-docker:{log4j-core-version}' +runtimeOnly 'org.apache.logging.log4j:log4j-docker' ---- ==== \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-flume-ng.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-flume-ng.adoc index 8bde662e7b..8e6c67f808 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-flume-ng.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-flume-ng.adoc @@ -19,7 +19,7 @@ ==== Maven:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,xml,subs="+attributes"] ---- @@ -32,7 +32,7 @@ We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency mana Gradle:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,groovy,subs="+attributes"] ---- diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-iostreams.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-iostreams.adoc deleted file mode 100644 index 1c0afce3c4..0000000000 --- a/src/site/antora/modules/ROOT/partials/components/log4j-iostreams.adoc +++ /dev/null @@ -1,40 +0,0 @@ -//// - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -//// - -[tabs] -==== -Maven:: -+ -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. -+ -[source,xml,subs="+attributes"] ----- -<dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-iostreams</artifactId> -</dependency> ----- - -Gradle:: -+ -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. -+ -[source,groovy,subs="+attributes"] ----- -implementation 'org.apache.logging.log4j:log4j-iostreams' ----- -==== \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-jcl.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-jcl.adoc deleted file mode 100644 index fef435ab29..0000000000 --- a/src/site/antora/modules/ROOT/partials/components/log4j-jcl.adoc +++ /dev/null @@ -1,41 +0,0 @@ -//// - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -//// - -[tabs] -==== -Maven:: -+ -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. -+ -[source,xml,subs="+attributes"] ----- -<dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-jcl</artifactId> - <scope>runtime</scope> -</dependency> ----- - -Gradle:: -+ -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. -+ -[source,groovy,subs="+attributes"] ----- -runtimeOnly 'org.apache.logging.log4j:log4j-jcl' ----- -==== \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jctools.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-jctools.adoc similarity index 94% rename from src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jctools.adoc rename to src/site/antora/modules/ROOT/partials/components/log4j-jctools.adoc index 590e3c1f8b..3881b6a4c4 100644 --- a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jctools.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-jctools.adoc @@ -21,7 +21,7 @@ Maven:: + We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + -[source,xml,subs="+attributes"] +[source,xml] ---- <dependency> <groupId>org.apache.logging.log4j</groupId> @@ -34,7 +34,7 @@ Gradle:: + We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + -[source,groovy,subs="+attributes"] +[source,groovy] ---- runtimeOnly 'org.apache.logging.log4j:log4j-jctools' ---- diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-jdbc-dbcp2.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-jdbc-dbcp2.adoc index cd6577afca..388a4d2248 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-jdbc-dbcp2.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-jdbc-dbcp2.adoc @@ -19,7 +19,7 @@ ==== Maven:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,xml,subs="+attributes"] ---- @@ -32,7 +32,7 @@ We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency mana Gradle:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,groovy,subs="+attributes"] ---- diff --git a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jdbc.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-jdbc.adoc similarity index 100% rename from src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jdbc.adoc rename to src/site/antora/modules/ROOT/partials/components/log4j-jdbc.adoc diff --git a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jndi.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-jndi.adoc similarity index 84% rename from src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jndi.adoc rename to src/site/antora/modules/ROOT/partials/components/log4j-jndi.adoc index c0ad9a9ed3..2679ca71a3 100644 --- a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jndi.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-jndi.adoc @@ -19,9 +19,10 @@ ==== Maven:: + +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. ++ [source,xml] ---- -<!-- We assume you use `log4j-bom` for dependency management --> <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-jndi</artifactId> @@ -31,9 +32,10 @@ Maven:: Gradle:: + -[source,groovy,subs=+attributes] +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. ++ +[source,groovy] ---- -// We assume you use `log4j-bom` for dependency management runtimeOnly 'org.apache.logging.log4j:log4j-jndi' ---- -==== +==== \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-jpa.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-jpa.adoc deleted file mode 100644 index bf7a763a59..0000000000 --- a/src/site/antora/modules/ROOT/partials/components/log4j-jpa.adoc +++ /dev/null @@ -1,41 +0,0 @@ -//// - Licensed to the Apache Software Foundation (ASF) under one or more - contributor license agreements. See the NOTICE file distributed with - this work for additional information regarding copyright ownership. - The ASF licenses this file to You under the Apache License, Version 2.0 - (the "License"); you may not use this file except in compliance with - the License. You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - - Unless required by applicable law or agreed to in writing, software - distributed under the License is distributed on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - See the License for the specific language governing permissions and - limitations under the License. -//// - -[tabs] -==== -Maven:: -+ -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. -+ -[source,xml,subs="+attributes"] ----- -<dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-jpa</artifactId> - <scope>runtime</scope> -</dependency> ----- - -Gradle:: -+ -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. -+ -[source,groovy,subs="+attributes"] ----- -runtimeOnly 'org.apache.logging.log4j:log4j-jpa' ----- -==== \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-jpl.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-jpl.adoc index 63a50b0775..cf620717cd 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-jpl.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-jpl.adoc @@ -19,7 +19,7 @@ ==== Maven:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,xml,subs="+attributes"] ---- @@ -32,7 +32,7 @@ We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency mana Gradle:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,groovy,subs="+attributes"] ---- diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-json-template-layout.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-json-template-layout.adoc index b402de984d..2c620c4e4c 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-json-template-layout.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-json-template-layout.adoc @@ -19,7 +19,7 @@ ==== Maven:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,xml,subs="+attributes"] ---- @@ -32,7 +32,7 @@ We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency mana Gradle:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,groovy,subs="+attributes"] ---- diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-jul.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-jul.adoc index ccef01bb69..debb82bcd2 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-jul.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-jul.adoc @@ -19,7 +19,7 @@ ==== Maven:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,xml,subs="+attributes"] ---- @@ -32,7 +32,7 @@ We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency mana Gradle:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,groovy,subs="+attributes"] ---- diff --git a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jdbc-dbcp2.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-kit.adoc similarity index 78% rename from src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jdbc-dbcp2.adoc rename to src/site/antora/modules/ROOT/partials/components/log4j-kit.adoc index f4abc566e0..ec7e19b0d9 100644 --- a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jdbc-dbcp2.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-kit.adoc @@ -19,21 +19,23 @@ ==== Maven:: + +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. ++ [source,xml] ---- -<!-- We assume you use `log4j-bom` for dependency management --> <dependency> <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-jdbc-dbcp2</artifactId> + <artifactId>log4j-kit</artifactId> <scope>runtime</scope> </dependency> ---- Gradle:: + +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. ++ [source,groovy] ---- -// We assume you use `log4j-bom` for dependency management -runtimeOnly 'org.apache.logging.log4j:log4j-jdbc-dbcp2' +runtimeOnly 'org.apache.logging.log4j:log4j-kit' ---- ==== \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-mongodb.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-mongodb.adoc index 27023d39ba..5fddbe373b 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-mongodb.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-mongodb.adoc @@ -19,7 +19,7 @@ ==== Maven:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,xml,subs="+attributes"] ---- @@ -32,7 +32,7 @@ We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency mana Gradle:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,groovy,subs="+attributes"] ---- diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-mongodb4.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-mongodb4.adoc index ff8809cb71..95c9a4667a 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-mongodb4.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-mongodb4.adoc @@ -19,7 +19,7 @@ ==== Maven:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,xml,subs="+attributes"] ---- @@ -32,7 +32,7 @@ We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency mana Gradle:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,groovy,subs="+attributes"] ---- diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-1.2-api.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-plugin-processor.adoc similarity index 91% copy from src/site/antora/modules/ROOT/partials/components/log4j-1.2-api.adoc copy to src/site/antora/modules/ROOT/partials/components/log4j-plugin-processor.adoc index d71c9ab4e5..4caa79e254 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-1.2-api.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-plugin-processor.adoc @@ -25,7 +25,7 @@ We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency man ---- <dependency> <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-1.2-api</artifactId> + <artifactId>log4j-plugin-processor</artifactId> <scope>runtime</scope> </dependency> ---- @@ -36,6 +36,6 @@ We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency man + [source,groovy] ---- -runtimeOnly 'org.apache.logging.log4j:log4j-1.2-api' +runtimeOnly 'org.apache.logging.log4j:log4j-plugin-processor' ---- ==== \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-1.2-api.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-plugins.adoc similarity index 92% copy from src/site/antora/modules/ROOT/partials/components/log4j-1.2-api.adoc copy to src/site/antora/modules/ROOT/partials/components/log4j-plugins.adoc index d71c9ab4e5..3a0794c162 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-1.2-api.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-plugins.adoc @@ -25,7 +25,7 @@ We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency man ---- <dependency> <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-1.2-api</artifactId> + <artifactId>log4j-plugins</artifactId> <scope>runtime</scope> </dependency> ---- @@ -36,6 +36,6 @@ We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency man + [source,groovy] ---- -runtimeOnly 'org.apache.logging.log4j:log4j-1.2-api' +runtimeOnly 'org.apache.logging.log4j:log4j-plugins' ---- ==== \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-1.2-api.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-script.adoc similarity index 92% rename from src/site/antora/modules/ROOT/partials/components/log4j-1.2-api.adoc rename to src/site/antora/modules/ROOT/partials/components/log4j-script.adoc index d71c9ab4e5..db8cbe4fbe 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-1.2-api.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-script.adoc @@ -25,7 +25,7 @@ We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency man ---- <dependency> <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-1.2-api</artifactId> + <artifactId>log4j-script</artifactId> <scope>runtime</scope> </dependency> ---- @@ -36,6 +36,6 @@ We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency man + [source,groovy] ---- -runtimeOnly 'org.apache.logging.log4j:log4j-1.2-api' +runtimeOnly 'org.apache.logging.log4j:log4j-script' ---- ==== \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-slf4j-impl.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-slf4j-impl.adoc index c74971ecdf..0a112a7f55 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-slf4j-impl.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-slf4j-impl.adoc @@ -19,7 +19,7 @@ ==== Maven:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,xml,subs="+attributes"] ---- @@ -32,7 +32,7 @@ We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency mana Gradle:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,groovy,subs="+attributes"] ---- diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-slf4j2-impl.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-slf4j2-impl.adoc index 40a108962e..26cccbe65e 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-slf4j2-impl.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-slf4j2-impl.adoc @@ -19,7 +19,7 @@ ==== Maven:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,xml,subs="+attributes"] ---- @@ -32,7 +32,7 @@ We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency mana Gradle:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,groovy,subs="+attributes"] ---- diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-spring-cloud-config-client.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-spring-cloud-config-client.adoc index ee447c9119..ad00814a26 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-spring-cloud-config-client.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-spring-cloud-config-client.adoc @@ -19,7 +19,7 @@ ==== Maven:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,xml,subs="+attributes"] ---- @@ -32,7 +32,7 @@ We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency mana Gradle:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,groovy,subs="+attributes"] ---- diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-to-jul.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-to-jul.adoc index 64d605af0d..7f0e1b6dfb 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-to-jul.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-to-jul.adoc @@ -19,7 +19,7 @@ ==== Maven:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,xml,subs="+attributes"] ---- @@ -32,7 +32,7 @@ We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency mana Gradle:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,groovy,subs="+attributes"] ---- diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-to-slf4j.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-to-slf4j.adoc index ffdbd41942..59221a0d3f 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-to-slf4j.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-to-slf4j.adoc @@ -19,7 +19,7 @@ ==== Maven:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,xml,subs="+attributes"] ---- @@ -32,7 +32,7 @@ We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency mana Gradle:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,groovy,subs="+attributes"] ---- diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-web.adoc b/src/site/antora/modules/ROOT/partials/components/log4j-web.adoc index faf1012768..ab56b13bb2 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-web.adoc +++ b/src/site/antora/modules/ROOT/partials/components/log4j-web.adoc @@ -19,7 +19,7 @@ ==== Maven:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,xml,subs="+attributes"] ---- @@ -32,7 +32,7 @@ We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency mana Gradle:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. +We assume you use xref:components.adoc#log4j-bom[`log4j-bom`] for dependency management. + [source,groovy,subs="+attributes"] ---- diff --git a/src/site/antora/modules/ROOT/partials/configuration-file-format-deps.adoc b/src/site/antora/modules/ROOT/partials/configuration-file-format-deps.adoc index 58c281fb68..35fc63b20a 100644 --- a/src/site/antora/modules/ROOT/partials/configuration-file-format-deps.adoc +++ b/src/site/antora/modules/ROOT/partials/configuration-file-format-deps.adoc @@ -15,88 +15,31 @@ limitations under the License. //// -[tabs] -==== - -Maven:: -+ [tabs] ===== log4j2.xml:: + -JPMS users need to add: -+ -[source,java] ----- -module foo.bar { - requires java.xml; -} ----- -+ -to their `module-info.java` descriptor. - -log4j2.json:: -+ -No dependency required. - -log4j2.yaml:: -+ -[source,xml] ----- -<dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-config-yaml</artifactId> -</dependency> ----- - -log4j2.properties:: -+ -[source,xml] ----- -<dependency> - <groupId>org.apache.logging.log4j</groupId> - <artifactId>log4j-config-properties</artifactId> -</dependency> ----- - -===== - -Gradle:: -+ -[tabs] -===== - -log4j2.xml:: -+ -JPMS users need to add: -+ -[source,java] ----- -module foo.bar { - requires java.xml; -} ----- -+ -to their `module-info.java` descriptor. +-- +include::partial$features/config-xml.adoc[] +-- log4j2.json:: + -No dependency required. +-- +include::partial$features/config-json.adoc[] +-- log4j2.yaml:: + -[source,groovy] ----- -runtimeOnly 'org.apache.logging.log4j:log4j-config-yaml' ----- +-- +include::partial$features/config-yaml.adoc[] +-- log4j2.properties:: + -[source,groovy] ----- -runtimeOnly 'org.apache.logging.log4j:log4j-config-properties' ----- +-- +include::partial$features/config-properties.adoc[] +-- ===== -==== diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-api.adoc b/src/site/antora/modules/ROOT/partials/features/api.adoc similarity index 100% rename from src/site/antora/modules/ROOT/partials/components/log4j-api.adoc rename to src/site/antora/modules/ROOT/partials/features/api.adoc diff --git a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-jms.adoc b/src/site/antora/modules/ROOT/partials/features/appender-jms.adoc similarity index 100% rename from src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-jms.adoc rename to src/site/antora/modules/ROOT/partials/features/appender-jms.adoc diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-jakarta-smtp.adoc b/src/site/antora/modules/ROOT/partials/features/appender-smtp.adoc similarity index 75% rename from src/site/antora/modules/ROOT/partials/components/log4j-jakarta-smtp.adoc rename to src/site/antora/modules/ROOT/partials/features/appender-smtp.adoc index aadce9c4a1..c8f550359b 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-jakarta-smtp.adoc +++ b/src/site/antora/modules/ROOT/partials/features/appender-smtp.adoc @@ -15,27 +15,27 @@ limitations under the License. //// +// This file exists in both the 2.x and 3.x branches. +// It contains the dependencies required to enable the SMTP appender. + [tabs] ==== Maven:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. -+ -[source,xml,subs="+attributes"] +[source,xml,subs=+attributes] ---- <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-jakarta-smtp</artifactId> + <version>{log4j-jakarta-version}</version> <scope>runtime</scope> </dependency> ---- Gradle:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. -+ -[source,groovy,subs="+attributes"] +[source,groovy,subs=+attributes] ---- -runtimeOnly 'org.apache.logging.log4j:log4j-jakarta-smtp' +runtimeOnly 'org.apache.logging.log4j:log4j-jakarta-smtp:{log4j-jakarta-version}' ---- -==== \ No newline at end of file +==== diff --git a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-web.adoc b/src/site/antora/modules/ROOT/partials/features/async-logger.adoc similarity index 81% copy from src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-web.adoc copy to src/site/antora/modules/ROOT/partials/features/async-logger.adoc index 78c4fe89c4..88038de683 100644 --- a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-web.adoc +++ b/src/site/antora/modules/ROOT/partials/features/async-logger.adoc @@ -15,4 +15,7 @@ limitations under the License. //// -include::partial$components/log4j-jakarta-web.adoc[] +// This file exists in both the 2.x and 3.x branches. +// It contains the dependencies required to enable Asynchronous Loggers. + +include::partial$components/log4j-async-logger.adoc[] \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-web.adoc b/src/site/antora/modules/ROOT/partials/features/config-json.adoc similarity index 84% copy from src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-web.adoc copy to src/site/antora/modules/ROOT/partials/features/config-json.adoc index 78c4fe89c4..ba52062d6e 100644 --- a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-web.adoc +++ b/src/site/antora/modules/ROOT/partials/features/config-json.adoc @@ -15,4 +15,7 @@ limitations under the License. //// -include::partial$components/log4j-jakarta-web.adoc[] +// This file exists in both the 2.x and 3.x branches. +// It contains the dependencies required to enable JSON configuration. + +No dependency required. \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-web.adoc b/src/site/antora/modules/ROOT/partials/features/config-properties.adoc similarity index 80% copy from src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-web.adoc copy to src/site/antora/modules/ROOT/partials/features/config-properties.adoc index 78c4fe89c4..ba051da95c 100644 --- a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-web.adoc +++ b/src/site/antora/modules/ROOT/partials/features/config-properties.adoc @@ -15,4 +15,7 @@ limitations under the License. //// -include::partial$components/log4j-jakarta-web.adoc[] +// This file exists in both the 2.x and 3.x branches. +// It contains the dependencies required to enable Java properties configuration. + +include::partial$components/log4j-config-properties.adoc[] \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-web.adoc b/src/site/antora/modules/ROOT/partials/features/config-xml.adoc similarity index 76% copy from src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-web.adoc copy to src/site/antora/modules/ROOT/partials/features/config-xml.adoc index 78c4fe89c4..fab22f04a6 100644 --- a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-web.adoc +++ b/src/site/antora/modules/ROOT/partials/features/config-xml.adoc @@ -15,4 +15,16 @@ limitations under the License. //// -include::partial$components/log4j-jakarta-web.adoc[] +// This file exists in both the 2.x and 3.x branches. +// It contains the dependencies required to enable XML configuration. + +JPMS users need to add: + +[source,java] +---- +module foo.bar { + requires java.xml; +} +---- + +to their `module-info.java` descriptor. \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-web.adoc b/src/site/antora/modules/ROOT/partials/features/config-yaml.adoc similarity index 82% copy from src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-web.adoc copy to src/site/antora/modules/ROOT/partials/features/config-yaml.adoc index 78c4fe89c4..729643b1c8 100644 --- a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-web.adoc +++ b/src/site/antora/modules/ROOT/partials/features/config-yaml.adoc @@ -15,4 +15,7 @@ limitations under the License. //// -include::partial$components/log4j-jakarta-web.adoc[] +// This file exists in both the 2.x and 3.x branches. +// It contains the dependencies required to enable YAML configuration. + +include::partial$components/log4j-config-yaml.adoc[] \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-web.adoc b/src/site/antora/modules/ROOT/partials/features/layout-csv.adoc similarity index 83% copy from src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-web.adoc copy to src/site/antora/modules/ROOT/partials/features/layout-csv.adoc index 78c4fe89c4..474080cf66 100644 --- a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-web.adoc +++ b/src/site/antora/modules/ROOT/partials/features/layout-csv.adoc @@ -15,4 +15,7 @@ limitations under the License. //// -include::partial$components/log4j-jakarta-web.adoc[] +// This file exists in both the 2.x and 3.x branches. +// It contains the dependencies required to enable CSV Layouts. + +include::partial$components/log4j-csv.adoc[] diff --git a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-web.adoc b/src/site/antora/modules/ROOT/partials/features/queue-jctools.adoc similarity index 81% rename from src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-web.adoc rename to src/site/antora/modules/ROOT/partials/features/queue-jctools.adoc index 78c4fe89c4..e2a45b54b4 100644 --- a/src/site/antora/modules/ROOT/partials/manual/dependencies-log4j-jakarta-web.adoc +++ b/src/site/antora/modules/ROOT/partials/features/queue-jctools.adoc @@ -15,4 +15,7 @@ limitations under the License. //// -include::partial$components/log4j-jakarta-web.adoc[] +// This file exists in both the 2.x and 3.x branches. +// It contains the dependencies required to enable the blocking queue based on JCTools. + +include::partial$components/log4j-jctools.adoc[] \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/components/log4j-jakarta-web.adoc b/src/site/antora/modules/ROOT/partials/features/servlet-support.adoc similarity index 80% rename from src/site/antora/modules/ROOT/partials/components/log4j-jakarta-web.adoc rename to src/site/antora/modules/ROOT/partials/features/servlet-support.adoc index 3e979b369a..476aa878c8 100644 --- a/src/site/antora/modules/ROOT/partials/components/log4j-jakarta-web.adoc +++ b/src/site/antora/modules/ROOT/partials/features/servlet-support.adoc @@ -15,27 +15,27 @@ limitations under the License. //// +// This file exists in both the 2.x and 3.x branches. +// It contains the dependencies required to enable Servlet environment support. + [tabs] ==== Maven:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. -+ [source,xml,subs="+attributes"] ---- <dependency> <groupId>org.apache.logging.log4j</groupId> <artifactId>log4j-jakarta-web</artifactId> + <version>{log4j-jakarta-version}</version> <scope>runtime</scope> </dependency> ---- Gradle:: + -We assume you use xref:artifacts.adoc#log4j-bom[`log4j-bom`] for dependency management. -+ [source,groovy,subs="+attributes"] ---- -runtimeOnly 'org.apache.logging.log4j:log4j-jakarta-web' +runtimeOnly 'org.apache.logging.log4j:log4j-jakarta-web:{log4j-jakarta-version}' ---- ==== \ No newline at end of file diff --git a/src/site/antora/modules/ROOT/partials/manual/api-intro.adoc b/src/site/antora/modules/ROOT/partials/manual/api-intro.adoc index 86733b8ef0..6027dd26ed 100644 --- a/src/site/antora/modules/ROOT/partials/manual/api-intro.adoc +++ b/src/site/antora/modules/ROOT/partials/manual/api-intro.adoc @@ -18,7 +18,7 @@ To log, you need a {log4j2-url}/javadoc/log4j-api/org/apache/logging/log4j/Logger.html[`Logger`] instance which you will retrieve from the {log4j2-url}/javadoc/log4j-api/org/apache/logging/log4j/LogManager.html[`LogManager`]. These are all part of the `log4j-api` module, which you can install as follows: -include::partial$components/log4j-api.adoc[] +include::partial$features/api.adoc[] You can use the `Logger` instance to log by using methods like `info()`, `warn()`, `error()`, etc. These methods are named after the _log levels_ they represent, a way to categorize log events by severity. diff --git a/src/site/antora/modules/ROOT/partials/manual/log-event.adoc b/src/site/antora/modules/ROOT/partials/manual/log-event.adoc index 967b90d1a5..d2a0eb62ac 100644 --- a/src/site/antora/modules/ROOT/partials/manual/log-event.adoc +++ b/src/site/antora/modules/ROOT/partials/manual/log-event.adoc @@ -30,7 +30,9 @@ Log events contain fields that can be classified into three categories: . Some fields are provided explicitly, in a link:../javadoc/log4j-api/org/apache/logging/log4j/Logger.html[`Logger`] method call. The most important are the log level and the log message, which is a description of what happened, and it is addressed to humans. -. Some fields are contextual (e.g., xref:manual/thread-context.adoc[]) and are either provided explicitly by developers of other parts of the application, or is injected by Java instrumentation. +. Some fields are contextual (e.g., +{log4j2-url}/manual/thread-context.html[Thread Context]) +and are either provided explicitly by developers of other parts of the application, or is injected by Java instrumentation. . The last category of fields is those that are computed automatically by the logging implementation employed. @@ -42,15 +44,15 @@ include::example$manual/messages/log-event.json[] ---- <1> Explicitly supplied fields: -`log.level`:: The xref:manual/customloglevels.adoc[level] of the event, either explicitly provided as an argument to the logger call, or implied by the name of the logger method +`log.level`:: {log4j2-url}/manual/customloglevels.html[level] of the event, either explicitly provided as an argument to the logger call, or implied by the name of the logger method `message`:: The **log message** that describes what happened `error.*`:: An _optional_ `Throwable` explicitly passed as an argument to the logger call -`marker`:: An _optional_ xref:manual/markers.adoc[marker] explicitly passed as an argument to the logger call -`log.logger`:: The xref:manual/api.adoc#logger-names[logger name] provided explicitly to `LogManager.getLogger()` or inferred by Log4j API +`marker`:: An _optional_ {log4j2-url}manual/markers.html[marker] explicitly passed as an argument to the logger call +`log.logger`:: The {log4j2-url}/manual/api.html#logger-names[logger name] provided explicitly to `LogManager.getLogger()` or inferred by Log4j API <2> Contextual fields: -`tags`:: The xref:manual/thread-context.adoc[] stack -`labels`:: The xref:manual/thread-context.adoc[] map +`tags`:: The {log4j2-url}/manual/thread-context.html[Thread Context] stack +`labels`:: The {log4j2-url}/manual/thread-context.html[Thread Context] map <3> Logging backend specific fields. In case you are using Log4j Core, the following fields can be automatically generated:
