This is an automated email from the ASF dual-hosted git repository. rgoers pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git
The following commit(s) were added to refs/heads/main by this push: new 4ced62bce4 Work on the web site 4ced62bce4 is described below commit 4ced62bce4d5968bb9c5c7305de80a24b62d9bdb Author: Ralph Goers <rgo...@apache.org> AuthorDate: Mon May 29 22:34:39 2023 -0700 Work on the web site --- pom.xml | 7 +- src/site/asciidoc/articles.adoc | 5 +- src/site/asciidoc/download.adoc | 4 + src/site/asciidoc/faq.adoc | 5 + src/site/asciidoc/guidelines.adoc | 4 + src/site/asciidoc/{index.adoc => index.adoc.vm} | 111 ++--- src/site/asciidoc/javadoc.adoc | 5 +- src/site/asciidoc/javastyle.adoc | 4 + src/site/asciidoc/log4j-transform.adoc | 4 + src/site/asciidoc/manual/api.adoc | 3 + src/site/asciidoc/manual/appenders.adoc | 116 ++--- src/site/asciidoc/manual/architecture.adoc | 4 + src/site/asciidoc/manual/async.adoc | 4 + src/site/asciidoc/manual/configuration.adoc | 4 + src/site/asciidoc/manual/customconfig.adoc | 4 + src/site/asciidoc/manual/customloglevels.adoc | 4 + src/site/asciidoc/manual/dependencyinjection.adoc | 4 + src/site/asciidoc/manual/eventlogging.adoc | 4 + src/site/asciidoc/manual/extending.adoc | 4 + src/site/asciidoc/manual/filters.adoc | 4 + src/site/asciidoc/manual/flowtracing.adoc | 4 + src/site/asciidoc/manual/garbagefree.adoc | 4 + src/site/asciidoc/manual/index.adoc | 4 + src/site/asciidoc/manual/jmx.adoc | 4 + .../asciidoc/manual/json-template-layout.adoc.vm | 4 + src/site/asciidoc/manual/layouts.adoc | 4 + src/site/asciidoc/manual/logbuilder.adoc | 4 + src/site/asciidoc/manual/logsep.adoc | 4 + src/site/asciidoc/manual/lookups.adoc | 4 + src/site/asciidoc/manual/markers.adoc | 4 + src/site/asciidoc/manual/messages.adoc | 4 + src/site/asciidoc/manual/migration.adoc | 4 + src/site/asciidoc/manual/plugins.adoc | 4 + src/site/asciidoc/manual/scala-api.adoc | 4 + src/site/asciidoc/manual/systemproperties.adoc | 7 +- src/site/asciidoc/manual/thread-context.adoc | 4 + src/site/asciidoc/manual/usage.adoc | 5 +- src/site/asciidoc/manual/webapp.adoc | 4 + src/site/asciidoc/performance.adoc | 4 + src/site/asciidoc/runtime-dependencies.adoc | 4 + src/site/asciidoc/security.adoc | 5 +- src/site/asciidoc/support.adoc | 5 +- src/site/asciidoc/thanks.adoc | 4 + src/site/markdown/log4j-spring-boot.md | 11 +- src/site/resources/css/asciidoctor-classic.css | 527 +++++++++++++++++++++ src/site/resources/css/tables.css | 95 ++++ src/site/resources/images/logo.png | Bin 33655 -> 35964 bytes src/site/site.xml | 5 +- 48 files changed, 914 insertions(+), 126 deletions(-) diff --git a/pom.xml b/pom.xml index 6c6289c842..c0bc4ecb7f 100644 --- a/pom.xml +++ b/pom.xml @@ -33,7 +33,7 @@ <name>Apache Log4j 2</name> <description>Apache Log4j 2</description> - <url>https://logging.apache.org/log4j/2.x/</url> + <url>https://logging.apache.org/log4j/3.x/</url> <inceptionYear>1999</inceptionYear> @@ -303,7 +303,7 @@ Release-specific properties =========================== --> <log4jParentDir>${basedir}</log4jParentDir> - <log4jReleaseVersion>3.0.0</log4jReleaseVersion> + <log4jReleaseVersion>3.0.0-alpha1</log4jReleaseVersion> <log4jReleaseManager>Ralph Goers</log4jReleaseManager> <log4jReleaseKey>B3D8E1BA</log4jReleaseKey> <log4jSigningUserName>rgo...@apache.org</log4jSigningUserName> @@ -354,7 +354,7 @@ <!-- ================================================= Plugin version properties (in alphabetical order) ================================================= --> - <asciidoctor-maven-plugin.version>2.2.2</asciidoctor-maven-plugin.version> + <asciidoctor-maven-plugin.version>2.2.4</asciidoctor-maven-plugin.version> <build-helper-maven-plugin.version>3.3.0</build-helper-maven-plugin.version> <checksum-maven-plugin.version>1.11</checksum-maven-plugin.version> <docker-maven-plugin.version>0.40.2</docker-maven-plugin.version> @@ -1545,6 +1545,7 @@ <exclude>**/rabbitmq.config</exclude> <exclude>**/MANIFEST.MF</exclude> <exclude>.surefire-*</exclude> + <exclude>**/*.slim</exclude> </excludes> </configuration> <executions> diff --git a/src/site/asciidoc/articles.adoc b/src/site/asciidoc/articles.adoc index 6680f4b890..105029af4b 100644 --- a/src/site/asciidoc/articles.adoc +++ b/src/site/asciidoc/articles.adoc @@ -14,9 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. //// - = Articles and Tutorials +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + A collection of external articles and tutorials about Log4j 2. The manual/index.html[Log4j 2 manual] is the ultimate guide for up-to-date and detailed information on how to configure and use Log4j 2. diff --git a/src/site/asciidoc/download.adoc b/src/site/asciidoc/download.adoc index 8c3c1a3729..211f6cc74b 100644 --- a/src/site/asciidoc/download.adoc +++ b/src/site/asciidoc/download.adoc @@ -16,6 +16,10 @@ //// = Download Apache Log4j 2 +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + Apache Log4j 2 is distributed under the https://www.apache.org/licenses/LICENSE-2.0.html[Apache License, version 2.0]. diff --git a/src/site/asciidoc/faq.adoc b/src/site/asciidoc/faq.adoc index d7038ac0aa..1dea0a0496 100644 --- a/src/site/asciidoc/faq.adoc +++ b/src/site/asciidoc/faq.adoc @@ -15,6 +15,11 @@ limitations under the License. //// = Frequently Asked Questions + +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + :toc: ''' diff --git a/src/site/asciidoc/guidelines.adoc b/src/site/asciidoc/guidelines.adoc index 22a4c581c7..7b36f3efb1 100644 --- a/src/site/asciidoc/guidelines.adoc +++ b/src/site/asciidoc/guidelines.adoc @@ -16,6 +16,10 @@ //// = Apache Log4j Project Guidelines +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + This document defines the guidelines for the https://logging.apache.org/log4j/2.x[Apache Log4j Project]. It includes definitions of how conflict is resolved by voting, who is able to vote, diff --git a/src/site/asciidoc/index.adoc b/src/site/asciidoc/index.adoc.vm similarity index 53% rename from src/site/asciidoc/index.adoc rename to src/site/asciidoc/index.adoc.vm index d51b78e90a..a044d97bb3 100644 --- a/src/site/asciidoc/index.adoc +++ b/src/site/asciidoc/index.adoc.vm @@ -14,11 +14,40 @@ See the License for the specific language governing permissions and limitations under the License. //// -= Apache Log4j 2 += Apache Log4j 3.x -Apache Log4j 2 is an upgrade to Log4j that provides significant improvements over its predecessor, Log4j 1.x, and +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + +Apache Log4j 3.x is an upgrade to Log4j 1.x and 2.x that provides significant improvements over its predecessors and provides many of the improvements available in Logback while fixing some inherent problems in Logback's architecture. +== Major Changes From Log4j 2.x + +As the Java ecosystem has evolved, requests have been received from users, and the need for improved security has +become more apparent, changes were necessariy in Log4j's design: + +* With the introduction of the Java Platform Module System (JPMS) changes were needed to how the various log4j modules +are packaged. While not every log4j module is now a fully compliant JPMS module with its own module-info.java file, +all the modules likely to be used in a JPMS environment are. +* Many optional components, such as Scripting, JNDI, JPA and JMS, have been moved to their own modules. This makes +Log4j-core slightly smaller in 3.x and aids in security by not having jars with unwanted behaviors present, making +disabling them via system properties unnecessary. +* All plugins constructed using Log4j 3.x are now located using Java's ServiceLoader. This avoids many of the problems +users had packaging plugins in "shaded" jars as that technology directly supports ServiceLoader. Plugins constructed +using Log4j 2.x will still function in Log4j 3.x. +* Log4j's annotation processor has been individually packaged separate from Log4j-core and the plugin system it enables. +For applications using the module path this makes it easier to provide the annotation processor since it must be +explicitly declared in those cases. +* Log4j 3.x now uses an internal dependency injection framework to allow plugins to be injected with instances of +classes they are dependent on. +* Many system properties used by Log4j can now be set to apply to a single LoggerContext making configuration +in application frameworks that support multiple applications more flexible. +* Some deprecated classes have been removed. However, every attempt has been made to ensure that user code compiled +for Log4j 2.x will continue to operate with the Log4j 3.x libraries present instead. + + == Features === API Separation @@ -50,22 +79,24 @@ See link:performance.html[Performance] for more information. === Support for multiple APIs -While the Log4j 2 API will provide the best performance, Log4j 2 provides support for the Log4j 1.2, SLF4J, Commons +While the Log4j 2.x/3.x API will provide the best performance, Log4j 3.x provides support for the Log4j 1.2, SLF4J, Commons Logging and java.util.logging (JUL) APIs. === Avoid lock-in -Applications coded to the Log4j 2 API always have the option to use any SLF4J-compliant library as their logger -implementation with the log4j-to-slf4j adapter. +Applications coded to the Log4j 3.x API have the option to use an SLF4J-compliant library as their logger +implementation with the log4j-to-slf4j adapter or use java.util.logging with the log4j-to-jul adapter. The +binding between the Log4j API and a Log4j implementation uses java.util.ServiceLoader making it easy to +create alternate implementations. === Automatic Reloading of Configurations -Like Logback, Log4j 2 can automatically reload its configuration upon modification. Unlike Logback, it will do so +Log4j 3.x can automatically reload its configuration upon modification. Unlike Logback, it will do so without losing log events while reconfiguration is taking place. === Advanced Filtering -Like Logback, Log4j 2 supports filtering based on context data, markers, regular expressions, and other components in +Log4j 3.x supports filtering based on context data, markers, regular expressions, and other components in the Log event. Filtering can be specified to apply to all events before being passed to Loggers or as they pass through Appenders. In addition, filters can also be associated with Loggers. Unlike Logback, you can use a common Filter class in any of these circumstances. @@ -83,7 +114,7 @@ underlying component that will dynamically resolve them. Properties come from va system properties, environment variables, the ThreadContext Map, and data present in the event. Users can further customize the property providers by adding their own link:manual/lookups.html[Lookup] Plugin. -=== Java 8 Lambda Support +=== Java Lambda Support Previously, if a log message was expensive to construct, you would often explicitly check if the requested log level is enabled before constructing the message. Client code running on Java 8 can benefit from Log4j's @@ -92,7 +123,7 @@ level is not enabled, the same effect can be achieved with less code. === Custom Log Levels -In Log4j 2, link:manual/customloglevels.html[custom log levels] can easily be defined in code or in configuration. No +In Log4j 3.x, link:manual/customloglevels.html[custom log levels] can easily be defined in code or in configuration. No subclassing is required. === Log Builder API @@ -101,66 +132,36 @@ link:manual/logbuilder.html[Log Builder] for more information. === Garbage-free -During steady state logging, Log4j 2 is link:manual/garbagefree.html[garbage-free] in stand-alone applications, and low +During steady state logging, Log4j 3.x is link:manual/garbagefree.html[garbage-free] in stand-alone applications, and low garbage in web applications. This reduces pressure on the garbage collector and can give better response time performance. -=== Integrating with Application Servers +=== Compatibility with Log4j 2.x -Version 2.10.0 introduces a the module log4j-appserver to improve integration with Apache Tomcat and Eclipse Jetty. +Application code written using the Log4j 2.x API should be binary compatible with Log4j 3.x. Custom plugins +written for Log4j 2.x may need minor changes when compiling with Log4j 3.x as some package names have changed. -=== Cloud Enabled +=== Compatibility with Log4j 1.x -Version 2.12.0 introduces support for accessing Docker container information via a Lookup and for accessing -and updating the Log4j configuration through Spring Cloud Configuration. This support was enhanced in -version 2.13.0 to add support for accessing Spring Boot properties as well as Kubernetes information. -See link:manual/cloud.html[Logging in the Cloud] for details. - -=== Compatible with Log4j 1.x - -The Log4j-1.2-api module of Log4j 2 provides compatiblity for applications using the Log4j 1 logging methods. As -of Log4j 2.13.0 Log4j 2 also provides experimental support for Log4j 1.x configuration files. See -link:manual/compatiblity.html[Log4j 2 Compatiblity with Log4j 1] for more information. +The Log4j-1.2-api module of Log4j 3.x provides compatiblity for applications using the Log4j 1 logging methods. +Log4j 3.x also provides experimental support for Log4j 1.x configuration files. See +link:manual/compatiblity.html[Log4j 3.x Compatiblity with Log4j 1] for more information. == Documentation -The Log4j 2 User's Guide is available on this link:manual/index.html[site]. +The Log4j 3.x User's Guide is available on this link:manual/index.html[site]. == Requirements -Log4j 2.13.0 and greater require Java 8. Version 2.4 through 2.12.1 required Java 7 and versions 2.0-alpha1 to 2.3 -required Java 6. Some features require optional dependencies; the documentation for these features specifies the -dependencies. +Log4j 3.x require a minimum of Java 11. For support for older versions of Java see the +link:http://logging.apache.org/2.x[Log4j 2.x site]. == News -Log4j {Log4jReleaseVersion} is now available for production. The API for Log4j 2 is not compatible with Log4j 1.x, however an adapter is -available to allow applications to continue to use the Log4j 1.x API. Adapters are also available for Apache Commons -Logging, SLF4J, and java.util.logging. +Log4j ${Log4jReleaseVersion} is now available for alpha testing. The API for Log4j 3.x is compatible with 2.x. -Log4j {Log4jReleaseVersion} is the latest release of Log4j and contains several bug fixes that were found after the release of Log4j 2.6. +Log4j ${Log4jReleaseVersion} is the latest release of Log4j. This release contains new features and fixes which are explained further in xref:release-notes/{Log4jReleaseVersion}.adoc[the release notes]. -Note that subsequent to the release of Log4j 2.6 a minor source incompatibility with prior release was found due to the -addition of new methods to the Logger interface. If you have code that does: - -[source,java] ----- -logger.error(null, "This is the log message", throwable); ----- - -or similar with any log level you will get a compiler error saying the reference is ambiguous. To correct this either -do: - -[source,java] ----- -logger.error("This is the log message", throwable); ----- - -or - -[source,java] ----- -logger.error((Marker) null, "This is the log message", throwable); ----- - -Log4j {Log4jReleaseVersion} maintains binary compatibility with previous releases. +Unless your application makes use of Log4j internal classes, Log4j {Log4jReleaseVersion} maintains binary +compatibility with previous releases. However, some code changes will be necessary when migrating plugins +built for Log4j 2.x to Log4j 3.x diff --git a/src/site/asciidoc/javadoc.adoc b/src/site/asciidoc/javadoc.adoc index 92405b7dec..dea964c3d3 100644 --- a/src/site/asciidoc/javadoc.adoc +++ b/src/site/asciidoc/javadoc.adoc @@ -14,9 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. //// - = Javadoc API Documentation +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + The table below contains links to the Javadoc API Documentation for the components you are most likely to use directly in code. You can also use the menu links on the left. diff --git a/src/site/asciidoc/javastyle.adoc b/src/site/asciidoc/javastyle.adoc index 23e644f98c..62a7bbcf8f 100644 --- a/src/site/asciidoc/javastyle.adoc +++ b/src/site/asciidoc/javastyle.adoc @@ -16,6 +16,10 @@ //// = Java Style Guidelines +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + [#intro] == Introduction diff --git a/src/site/asciidoc/log4j-transform.adoc b/src/site/asciidoc/log4j-transform.adoc index 25b8f1d316..2b2ee3ab73 100644 --- a/src/site/asciidoc/log4j-transform.adoc +++ b/src/site/asciidoc/log4j-transform.adoc @@ -16,6 +16,10 @@ //// = Log4j Transformation Tools +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + Log4j Transformation Tools is set of build utilities to transform source and binary artifacts that use Log4j 2.x libraries. The full documentation is available on https://github.com/apache/logging-log4j-transform/blob/main/README.adoc[Github]. diff --git a/src/site/asciidoc/manual/api.adoc b/src/site/asciidoc/manual/api.adoc index e06f28f079..b65fb8bf9e 100644 --- a/src/site/asciidoc/manual/api.adoc +++ b/src/site/asciidoc/manual/api.adoc @@ -16,6 +16,9 @@ //// = Log4j 2 API +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ == Overview The Log4j 2 API provides the interface that applications should code to diff --git a/src/site/asciidoc/manual/appenders.adoc b/src/site/asciidoc/manual/appenders.adoc index 654d3e10d5..bc70d6b75d 100644 --- a/src/site/asciidoc/manual/appenders.adoc +++ b/src/site/asciidoc/manual/appenders.adoc @@ -17,6 +17,10 @@ = Appenders Ralph Goers; Gary Gregory; Nick Williams; Matt Sicker +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + Appenders are responsible for delivering LogEvents to their destination. Every Appender must implement the link:../log4j-core/apidocs/org/apache/logging/log4j/core/Appender.html[`Appender`] @@ -66,7 +70,7 @@ become worse when more threads are logging concurrently. Consider using link:async.html[lock-free Async Loggers] for optimal performance. .AsyncAppender Parameters -[width="100%",cols="34%,33%,33%",options="header",] +[width="100%",cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |AppenderRef |String |The name of the Appenders to invoke @@ -174,7 +178,7 @@ plugin inside an `<Async/>` element like so: Log4j ships with the following implementations: .BlockingQueueFactory Implementations -[cols=",",options="header",] +[cols="25%,75%",options="header",] |======================================================================= |Plugin Name |Description |ArrayBlockingQueue |This is the default implementation that uses @@ -214,7 +218,7 @@ use the log event timestamp converted to that type (e.g., use `java.util.Date` to fill a `timestamp` column type in Cassandra). .CassandraAppender Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |batched |boolean |Whether or not to use batch statements to write log @@ -339,7 +343,7 @@ System.out or System.err with System.out being the default target. A Layout must be provided to format the LogEvent. .ConsoleAppender Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |filter |Filter |A Filter to determine if the event should be handled by @@ -402,7 +406,7 @@ fails the secondary appenders will be tried in order until one succeeds or there are no more secondaries to try. .FailoverAppender Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |filter |Filter |A Filter to determine if the event should be handled by @@ -471,7 +475,7 @@ safely write to the same file if Log4j is in a ClassLoader that is common to both of them. .FileAppender Parameters -[width="100%",cols="34%,33%,33%",options="header",] +[width="100%",cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |append |boolean |When true - the default, records will be appended to @@ -620,7 +624,7 @@ in the appender configuration will also cause the embedded agent to be used. .FlumeAppender Parameters -[width="100%",cols="34%,33%,33%",options="header",] +[width="100%",cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |agents |Agent[] |An array of Agents to which the logging events should @@ -868,7 +872,7 @@ connection string, a user name, and a password. Optionally, you can also use properties. .JDBCAppender Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |name |String |_Required._ The name of the Appender. @@ -944,7 +948,7 @@ to provide connection pooling. [#JDBCDataSource] .DataSource Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |jndiName |String |_Required._ The full, prefixed JNDI name that the @@ -955,7 +959,7 @@ by a connection pool; otherwise, logging will be very slow. [#JDBCConnectionFactory] .ConnectionFactory Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |class |Class |_Required._ The fully qualified name of a class @@ -973,7 +977,7 @@ be backed by a connection pool for the same reasons. [#JDBCDriverManager] .DriverManager Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |connectionString |String |_Required._ The driver-specific JDBC @@ -994,7 +998,7 @@ properties and a user name or password. [#JDBCPoolingDriver] .PoolingDriver Parameters (Apache Commons DBCP) -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |DriverManager parameters |DriverManager parameters |This connection @@ -1011,7 +1015,7 @@ a pooled connection elsewhere. For example: [#JDBCPoolableConnectionFactory] .PoolableConnectionFactory Parameters (Apache Commons DBCP) -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |autoCommitOnReturn |boolean | See http://commons.apache.org/proper/commons-dbcp/api-2.5.0/org/apache/commons/dbcp2/PoolableConnectionFactory.html[Apache Commons DBCP PoolableConnectionFactory.] @@ -1039,7 +1043,7 @@ to them. The JDBCAppender uses this information to formulate a vulnerability. .Column Parameters -[width="100%",cols="34%,33%,33%",options="header",] +[width="100%",cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |name |String |_Required._ The name of the database column. @@ -1091,7 +1095,7 @@ the value will be inserted as a VARCHAR or NVARCHAR (`setString` or |======================================================================= .ColumnMapping Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |name |String |_Required._ The name of the database column. @@ -1270,7 +1274,7 @@ and topics. However, configurations written for 2.0 which use the new `<JMS/>` configuration element. .JMS Appender Parameters -[cols=",,,",options="header",] +[cols="15%,15%,15%,55%",options="header",] |======================================================================= |Parameter Name |Type |Default |Description |allowdLdapClasses|String|null|A comma separated list of fully qualified class names that may be accessed by LDAP. @@ -1411,7 +1415,7 @@ source code of these two classes as an example of how to implement the entity. .JPAAppender Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |name |String |_Required._ The name of the Appender. @@ -1593,7 +1597,7 @@ Implemented with https://docs.oracle.com/javase/7/docs/api/java/net/HttpURLConnection.html[HttpURLConnection]. .HttpAppender Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |name |String |The name of the Appender. @@ -1660,7 +1664,7 @@ The KafkaAppender logs events to an https://kafka.apache.org/[Apache Kafka] topic. Each log event is sent as a Kafka record. .KafkaAppender Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |topic |String |The Kafka topic to use. Required. @@ -1776,7 +1780,7 @@ the same file if Log4j is in a ClassLoader that is common to both of them. .MemoryMappedFileAppender Parameters -[width="100%",cols="34%,33%,33%",options="header",] +[width="100%",cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |append |boolean |When true - the default, records will be appended to @@ -1856,7 +1860,7 @@ currently exist for MongoDB and Apache CouchDB, and writing a custom provider is quite simple. .NoSQLAppender Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |name |String |_Required._ The name of the Appender. @@ -1967,7 +1971,7 @@ MongoDB driver version 3. The NoSQLAppender Appender writes log events to a NoSQL database using an internal lightweight provider interface. .MongoDB3 Provider Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |collectionName |String |_Required._ The name of the MongoDB collection @@ -2072,7 +2076,7 @@ MongoDB driver version 4. The NoSQLAppender Appender writes log events to a NoSQL database using an internal lightweight provider interface. .MongoDB3 Provider Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |connection |String |_Required._ The MongoDB @@ -2140,7 +2144,7 @@ NoSQLAppender writes log events to a NoSQL database using an internal lightweight provider interface. .CouchDB Provider Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |factoryClassName |Class |To provide a connection to the CouchDB @@ -2224,7 +2228,7 @@ to the same file if Log4j is in a ClassLoader that is common to both of them. .RandomAccessFileAppender Parameters -[width="100%",cols="34%,33%,33%",options="header",] +[width="100%",cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |append |boolean |When true - the default, records will be appended to @@ -2303,7 +2307,7 @@ RewriteAppender should be configured after any Appenders it references to allow it to shut down properly. .RewriteAppender Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |AppenderRef |String |The name of the Appenders to call after the @@ -2340,7 +2344,7 @@ MapRewritePolicy MapRewritePolicy will evaluate LogEvents that contain a MapMessage and will add or update elements of the Map. -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |================================================================ |Parameter Name |Type |Description |mode |String |"Add" or "Update" @@ -2381,7 +2385,7 @@ the actual ThreadContext Map. The property values may contain variables that will be evaluated when the configuration is processed as well as when the event is logged. -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |properties |Property[] |One of more Property elements to define the @@ -2423,7 +2427,7 @@ log event levels for a given logger name prefix. You configure a LoggerNameLevelRewritePolicy with a logger name prefix and a pairs of levels, where a pair defines a source level and a target level. -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |logger |String |A logger name used as a prefix to test each event's @@ -2495,7 +2499,7 @@ RollingFileAppender will be applied. File locking is not supported by the RollingFileAppender. .RollingFileAppender Parameters -[width="100%",cols="34%,33%,33%",options="header",] +[width="100%",cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |append |boolean |When true - the default, records will be appended to @@ -2639,7 +2643,7 @@ The filePattern attribute of the Appender should contain a timestamp otherwise t overwritten on each rollover. .CronTriggeringPolicy Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |schedule |String |The cron expression. The expression is the same as @@ -2660,7 +2664,7 @@ is older than the current JVM's start time and the minimum file size is met or exceeded. .OnStartupTriggeringPolicy Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |minSize |long |The minimum size the file must have to roll over. A size @@ -2695,7 +2699,7 @@ pattern no longer applies to the active file. This policy accepts an occur based on the time pattern and a `modulate` boolean attribute. .TimeBasedTriggeringPolicy Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |interval |integer |How often a rollover should occur based on the most @@ -2748,7 +2752,7 @@ the counter. To illustrate how it works, suppose that the min attribute is set to 1, the max attribute is set to 3, the file name is "foo.log", and the file name pattern is "foo-%i.log". -[cols=",,,",options="header",] +[cols="15%,15%,15%,55%",options="header",] |======================================================================= |Number of rollovers |Active output target |Archived log files |Description @@ -2775,7 +2779,7 @@ By way of contrast, when the fileIndex attribute is set to "min" but all the other settings are the same the "fixed window" strategy will be performed. -[cols=",,,",options="header",] +[cols="15%,15%,15%,55%",options="header",] |======================================================================= |Number of rollovers |Active output target |Archived log files |Description @@ -2805,7 +2809,7 @@ increment by 1 and each rollover will have an incrementally higher value with no maximum number of files. .DefaultRolloverStrategy Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |fileIndex |String |If set to "max" (the default), files with a higher @@ -2846,7 +2850,7 @@ pattern no longer matches the current file it will not be compressed at startup either. .DirectWriteRolloverStrategy Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |maxFiles |String |The maximum number of files to allow in the time @@ -3022,7 +3026,7 @@ can test your configuration without accidentally deleting the wrong files. .Delete Parameters -[width="100%",cols="34%,33%,33%",options="header",] +[width="100%",cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |basePath |String |_Required._ Base path from where to start scanning @@ -3101,7 +3105,7 @@ and must return a list with the paths to delete. == DeleteIfFileName .IfFileName Condition Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |glob |String |_Required if regex not specified._ Matches the relative @@ -3127,7 +3131,7 @@ the path name matches). == DeleteIfLastModified .IfLastModified Condition Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |age |String |_Required._ Specifies a @@ -3146,7 +3150,7 @@ the file is old enough). == DeleteIfAccumulatedFileCount .IfAccumulatedFileCount Condition Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |exceeds |int |_Required._ The threshold count from which files will be @@ -3163,7 +3167,7 @@ the threshold count has been exceeded). == DeleteIfAccumulatedFileSize .IfAccumulatedFileSize Condition Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |exceeds |String |_Required._ The threshold accumulated file size from @@ -3265,7 +3269,7 @@ comes first. == ScriptCondition .ScriptCondition Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |script |Script, ScriptFile or ScriptRef |The Script element that @@ -3280,7 +3284,7 @@ how ScriptFiles and ScriptRefs can be configured. == ScriptParameters .Script Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |basePath |`java.nio.file.Path` |The directory from where the Delete @@ -3380,7 +3384,7 @@ applied. The PosixViewAttribute action lets users configure one or more conditions that select the eligible files relative to a base directory. .PosixViewAttribute Parameters -[width="100%",cols="34%,33%,33%",options="header",] +[width="100%",cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |basePath |String |_Required._ Base path from where to start scanning @@ -3499,7 +3503,7 @@ in the DefaultRolloverStrategy to run at rollover. File locking is not supported by the RollingRandomAccessFileAppender. .RollingRandomAccessFileAppender Parameters -[width="100%",cols="34%,33%,33%",options="header",] +[width="100%",cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |append |boolean |When true - the default, records will be appended to @@ -3706,7 +3710,7 @@ script when the appender starts and when a route is chosen for an log event. .RoutingAppender Parameters -[width="100%",cols="34%,33%,33%",options="header",] +[width="100%",cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |Filter |Filter |A Filter to determine if the event should be handled by @@ -3728,7 +3732,7 @@ String Route key to determine the default Route. This script is passed the following variables: .RoutingAppender Script Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |configuration |Configuration |The active Configuration. @@ -3804,7 +3808,7 @@ a Route. This script is passed the following variables: .RoutingAppender Routes Script Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |configuration |Configuration |The active Configuration. @@ -3943,7 +3947,7 @@ or more filters on the Appender. As with other Appenders, the formatting can be controlled by specifying a Layout for the Appender. .SMTPAppender Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |name |String |The name of the Appender. @@ -4064,7 +4068,7 @@ is raised, causing those events to be lost. If guaranteed delivery is required a protocol that requires acknowledgements must be used. .`SocketAppender` Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |name |String |The name of the Appender. @@ -4171,7 +4175,7 @@ connection or a Secure Socket Layer (SSL) connection. This section documents the parameters available for SSL configuration. .SSL Configuration Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |protocol |String |The SSL protocol to use, `TLS` if omitted. A single value @@ -4194,7 +4198,7 @@ The keystore is meant to contain your private keys and certificates, and determines which authentication credentials to send to the remote host. .KeyStore Configuration Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |location |String |Path to the keystore file. @@ -4234,7 +4238,7 @@ better practice to use distinct stores (especially when they are file-based). .TrustStore Configuration Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |location |String |Path to the keystore file. @@ -4283,7 +4287,7 @@ conforms with either the BSD Syslog format or the RFC 5424 format. The data can be sent over either TCP or UDP. .`SyslogAppender` Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |advertise |boolean |Indicates whether the appender should be @@ -4479,7 +4483,7 @@ The table below describes all options. Please consult the JeroMQ and ZeroMQ documentation for details. .JeroMQ Parameters -[cols=",,",options="header",] +[cols="20%,20%,60%",options="header",] |======================================================================= |Parameter Name |Type |Description |name |String |The name of the Appender. Required. diff --git a/src/site/asciidoc/manual/architecture.adoc b/src/site/asciidoc/manual/architecture.adoc index 5f8ac9c860..9105a3a6a8 100644 --- a/src/site/asciidoc/manual/architecture.adoc +++ b/src/site/asciidoc/manual/architecture.adoc @@ -17,6 +17,10 @@ = Architecture Ralph Goers <rgo...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + == Main Components Log4j uses the classes shown in the diagram below. diff --git a/src/site/asciidoc/manual/async.adoc b/src/site/asciidoc/manual/async.adoc index dca45f00f2..743021835d 100644 --- a/src/site/asciidoc/manual/async.adoc +++ b/src/site/asciidoc/manual/async.adoc @@ -17,6 +17,10 @@ = Lock-free Asynchronous Loggers for Low-Latency Logging Remko Popma <rpo...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + Asynchronous logging can improve your application's performance by executing the I/O operations in a separate thread. Log4j 2 makes a number of improvements in this area. diff --git a/src/site/asciidoc/manual/configuration.adoc b/src/site/asciidoc/manual/configuration.adoc index e3bc3fa974..713348015a 100644 --- a/src/site/asciidoc/manual/configuration.adoc +++ b/src/site/asciidoc/manual/configuration.adoc @@ -17,6 +17,10 @@ = Configuration Ralph Goers <rgo...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + Inserting log requests into the application code requires a fair amount of planning and effort. Observation shows that approximately 4 percent of code is dedicated to logging. Consequently, even moderately sized diff --git a/src/site/asciidoc/manual/customconfig.adoc b/src/site/asciidoc/manual/customconfig.adoc index bddf4197ee..48d6053aa2 100644 --- a/src/site/asciidoc/manual/customconfig.adoc +++ b/src/site/asciidoc/manual/customconfig.adoc @@ -17,6 +17,10 @@ = Programmatic Configuration Ralph Goers <rgo...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + Log4j 2 provides a few ways for applications to create their own programmatic configuration: diff --git a/src/site/asciidoc/manual/customloglevels.adoc b/src/site/asciidoc/manual/customloglevels.adoc index c8c5ad11d2..c03e235502 100644 --- a/src/site/asciidoc/manual/customloglevels.adoc +++ b/src/site/asciidoc/manual/customloglevels.adoc @@ -17,6 +17,10 @@ = Custom Log Levels Remko Popma <rpo...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + [[top]] [#DefiningLevelsInCode] diff --git a/src/site/asciidoc/manual/dependencyinjection.adoc b/src/site/asciidoc/manual/dependencyinjection.adoc index 9d922d9326..43e764749b 100644 --- a/src/site/asciidoc/manual/dependencyinjection.adoc +++ b/src/site/asciidoc/manual/dependencyinjection.adoc @@ -17,6 +17,10 @@ = Dependency Injection Matt Sicker <mattsic...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + Log4j 3.x uses a more sophisticated dependency injection API inspired by https://javaee.github.io/javaee-spec/javadocs/javax/inject/package-summary.html[`javax.inject`] and its open source implementations such as https://github.com/zsoltherpai/feather[Feather] and https://github.com/google/guice[Guice]. Dependency injection can be thought of as a replacement for calling `new` or custom factory methods in Java code; alternatively, it can be thought of as a factory for factory instances. Classes define _injection points_ which may be fields, method parameters, and constructor parameters, whose values are injected at runtime. diff --git a/src/site/asciidoc/manual/eventlogging.adoc b/src/site/asciidoc/manual/eventlogging.adoc index d45fe7158b..93b2b75d3d 100644 --- a/src/site/asciidoc/manual/eventlogging.adoc +++ b/src/site/asciidoc/manual/eventlogging.adoc @@ -17,6 +17,10 @@ = Log4j 2 API Ralph Goers <rgo...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + [#EventLogging] == Event Logging diff --git a/src/site/asciidoc/manual/extending.adoc b/src/site/asciidoc/manual/extending.adoc index 7bcbedcd16..b14f319fb4 100644 --- a/src/site/asciidoc/manual/extending.adoc +++ b/src/site/asciidoc/manual/extending.adoc @@ -17,6 +17,10 @@ = Extending Log4j 3 Ralph Goers <rgo...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + Log4j 3 provides numerous ways that it can be manipulated and extended. This section includes an overview of the various ways that are directly supported by the Log4j 3 implementation. diff --git a/src/site/asciidoc/manual/filters.adoc b/src/site/asciidoc/manual/filters.adoc index 89a3b569ca..203b94fd7d 100644 --- a/src/site/asciidoc/manual/filters.adoc +++ b/src/site/asciidoc/manual/filters.adoc @@ -17,6 +17,10 @@ = Filters Ralph Goers <rgo...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + Filters allow Log Events to be evaluated to determine if or how they should be published. A Filter will be called on one of its `filter` methods and will return a `Result`, which is an Enum that has one of 3 diff --git a/src/site/asciidoc/manual/flowtracing.adoc b/src/site/asciidoc/manual/flowtracing.adoc index c4026612c0..6b4d5cd191 100644 --- a/src/site/asciidoc/manual/flowtracing.adoc +++ b/src/site/asciidoc/manual/flowtracing.adoc @@ -17,6 +17,10 @@ = Log4j 2 API Ralph Goers <rgo...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + [#FlowTracing] == Flow Tracing diff --git a/src/site/asciidoc/manual/garbagefree.adoc b/src/site/asciidoc/manual/garbagefree.adoc index d08a9564a4..ee924d67ba 100644 --- a/src/site/asciidoc/manual/garbagefree.adoc +++ b/src/site/asciidoc/manual/garbagefree.adoc @@ -17,6 +17,10 @@ = Garbage-free Steady State Logging Remko Popma <rpo...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + //// Different applications have different performance requirements. Some only need to worry about throughput, but for many diff --git a/src/site/asciidoc/manual/index.adoc b/src/site/asciidoc/manual/index.adoc index 57af253654..9b35957568 100644 --- a/src/site/asciidoc/manual/index.adoc +++ b/src/site/asciidoc/manual/index.adoc @@ -17,6 +17,10 @@ = Overview Ralph Goers <rgo...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + == Welcome to Log4j! Almost every large application includes its own logging or tracing API. diff --git a/src/site/asciidoc/manual/jmx.adoc b/src/site/asciidoc/manual/jmx.adoc index e434b0cff8..d2f0345c9e 100644 --- a/src/site/asciidoc/manual/jmx.adoc +++ b/src/site/asciidoc/manual/jmx.adoc @@ -17,6 +17,10 @@ = JMX Remko Popma <rem...@yahoo.com> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + Log4j 2 has built-in support for JMX. The StatusLogger, ContextSelector, and all LoggerContexts, LoggerConfigs and Appenders are instrumented with MBeans and can be remotely monitored and controlled. diff --git a/src/site/asciidoc/manual/json-template-layout.adoc.vm b/src/site/asciidoc/manual/json-template-layout.adoc.vm index ad61105033..6649aa1f00 100644 --- a/src/site/asciidoc/manual/json-template-layout.adoc.vm +++ b/src/site/asciidoc/manual/json-template-layout.adoc.vm @@ -18,6 +18,10 @@ = JSON Template Layout Volkan Yazıcı <v...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + `JsonTemplateLayout` is a customizable, efficient, and garbage-free JSON generating layout. It encodes ``LogEvent``s according to the structure described by the JSON template provided. In a nutshell, it shines with its diff --git a/src/site/asciidoc/manual/layouts.adoc b/src/site/asciidoc/manual/layouts.adoc index 659eab8c85..949e72e27e 100644 --- a/src/site/asciidoc/manual/layouts.adoc +++ b/src/site/asciidoc/manual/layouts.adoc @@ -17,6 +17,10 @@ = Layouts Ralph Goers <rgo...@apache.org>; Gary Gregory <ggreg...@apache.org>; Volkan Yazıcı <v...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + An Appender uses a Layout to format a LogEvent into a form that meets the needs of whatever will be consuming the log event. In Log4j 1.x and Logback Layouts were expected to transform an event into a String. In diff --git a/src/site/asciidoc/manual/logbuilder.adoc b/src/site/asciidoc/manual/logbuilder.adoc index a03687e88a..ebb5d2b55e 100644 --- a/src/site/asciidoc/manual/logbuilder.adoc +++ b/src/site/asciidoc/manual/logbuilder.adoc @@ -16,6 +16,10 @@ //// = Log4j 2 API +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + == Log Builder Log4j has traditionally been used with logging statements like diff --git a/src/site/asciidoc/manual/logsep.adoc b/src/site/asciidoc/manual/logsep.adoc index 9929297866..e2f4ce9c03 100644 --- a/src/site/asciidoc/manual/logsep.adoc +++ b/src/site/asciidoc/manual/logsep.adoc @@ -17,6 +17,10 @@ = Logging Separation Ralph Goers <rgo...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + There are many well known use cases where applications may share an environment with other applications and each has a need to have its own, separate logging environment. This purpose of this section is to discuss diff --git a/src/site/asciidoc/manual/lookups.adoc b/src/site/asciidoc/manual/lookups.adoc index 82c7691113..62fce3480b 100644 --- a/src/site/asciidoc/manual/lookups.adoc +++ b/src/site/asciidoc/manual/lookups.adoc @@ -17,6 +17,10 @@ = Lookups Ralph Goers <rgo...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + Lookups provide a way to add values to the Log4j configuration at arbitrary places. They are a particular type of Plugin that implements the diff --git a/src/site/asciidoc/manual/markers.adoc b/src/site/asciidoc/manual/markers.adoc index c705f7163a..d5bdd5e35e 100644 --- a/src/site/asciidoc/manual/markers.adoc +++ b/src/site/asciidoc/manual/markers.adoc @@ -17,6 +17,10 @@ = Log4j 2 API Ralph Goers <rgo...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + [#Markers] == Markers diff --git a/src/site/asciidoc/manual/messages.adoc b/src/site/asciidoc/manual/messages.adoc index 5d7ae605f2..39b7ae248e 100644 --- a/src/site/asciidoc/manual/messages.adoc +++ b/src/site/asciidoc/manual/messages.adoc @@ -17,6 +17,10 @@ = Log4j 2 API Ralph Goers <rgo...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + [#Messages] == Messages diff --git a/src/site/asciidoc/manual/migration.adoc b/src/site/asciidoc/manual/migration.adoc index dd9d260af4..3a9a4386ba 100644 --- a/src/site/asciidoc/manual/migration.adoc +++ b/src/site/asciidoc/manual/migration.adoc @@ -17,6 +17,10 @@ = Migrating from Log4j 1.x Ralph Goers <rgo...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + [#Log4j1.2Bridge] == When to use this the Log4j 1.x bridge diff --git a/src/site/asciidoc/manual/plugins.adoc b/src/site/asciidoc/manual/plugins.adoc index 3185575c79..d5e003bcea 100644 --- a/src/site/asciidoc/manual/plugins.adoc +++ b/src/site/asciidoc/manual/plugins.adoc @@ -17,6 +17,10 @@ = Plugins Ralph Goers <rgo...@apache.org>; Matt Sicker <mattsic...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + Log4j 1.x allowed for extension by requiring class attributes on most of the configuration declarations. In the case of some elements, notably the PatternLayout, the only way to add new pattern converters was to diff --git a/src/site/asciidoc/manual/scala-api.adoc b/src/site/asciidoc/manual/scala-api.adoc index 685f370543..fe66b18f3c 100644 --- a/src/site/asciidoc/manual/scala-api.adoc +++ b/src/site/asciidoc/manual/scala-api.adoc @@ -17,6 +17,10 @@ = Log4j 2 Scala API Mikael Ståldal <mi...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + Log4j 2 has a companion Log4j Scala project that contains a convenient Scala wrapper for the link:../log4j-api/apidocs/org/apache/logging/log4j/Logger.html[`Logger`] diff --git a/src/site/asciidoc/manual/systemproperties.adoc b/src/site/asciidoc/manual/systemproperties.adoc index 76592abdaf..ba83302025 100644 --- a/src/site/asciidoc/manual/systemproperties.adoc +++ b/src/site/asciidoc/manual/systemproperties.adoc @@ -14,6 +14,9 @@ See the License for the specific language governing permissions and limitations under the License. //// +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ [#SystemProperties] == System Properties @@ -86,7 +89,7 @@ Properties can be overridden by sources with a lower number priority by default: .PropertySource priorities and descriptions -[cols="2,1,5"] +[cols="2,1,5",frame="all"] |=== |Source |Priority |Description @@ -132,7 +135,7 @@ fits into, the alias includes values from Log4j 2.x that are still allowed, the the setting may be applied system wide and/or to a LoggerContext. .Log4j 2 API configuration properties -[cols="1,1,3,1,2,3"] +[cols="1,1,3,1,2,3",frame="all"] |=== |Component Name |Property Key |Alias |Scope |Default Value |Description diff --git a/src/site/asciidoc/manual/thread-context.adoc b/src/site/asciidoc/manual/thread-context.adoc index c90501d357..70237ef3fa 100644 --- a/src/site/asciidoc/manual/thread-context.adoc +++ b/src/site/asciidoc/manual/thread-context.adoc @@ -17,6 +17,10 @@ = Log4j 2 API Ralph Goers <rgo...@apache.org>; Gary Gregory <ggreg...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + == Thread Context Log4j introduced the concept of the Mapped Diagnostic Context or MDC. It diff --git a/src/site/asciidoc/manual/usage.adoc b/src/site/asciidoc/manual/usage.adoc index 1eaa5e40c4..5781fc717b 100644 --- a/src/site/asciidoc/manual/usage.adoc +++ b/src/site/asciidoc/manual/usage.adoc @@ -14,9 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. //// - = Usage +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + [#Static_vs_Non_Static] == Static vs Non-Static Loggers As with any variable in Java, Loggers may be declared as static variables or class member variables. However, diff --git a/src/site/asciidoc/manual/webapp.adoc b/src/site/asciidoc/manual/webapp.adoc index f4d2c410bd..d60e35d261 100644 --- a/src/site/asciidoc/manual/webapp.adoc +++ b/src/site/asciidoc/manual/webapp.adoc @@ -17,6 +17,10 @@ = Web Applications Nick Williams <nickwilli...@apache.org>; Matt Sicker <mattsic...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + == Using Log4j 2 in Web Applications You must take particular care when using Log4j or any other logging diff --git a/src/site/asciidoc/performance.adoc b/src/site/asciidoc/performance.adoc index cb82e84ff3..621a5703c1 100644 --- a/src/site/asciidoc/performance.adoc +++ b/src/site/asciidoc/performance.adoc @@ -17,6 +17,10 @@ = Performance Remko Popma <rpo...@apache.org>; Ralph Goers <rgo...@apache.org> +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + //// One of the often-cited arguments against logging is its computational cost. This is a legitimate concern as even moderately diff --git a/src/site/asciidoc/runtime-dependencies.adoc b/src/site/asciidoc/runtime-dependencies.adoc index c8cc8d52c9..2b3ae8abb7 100644 --- a/src/site/asciidoc/runtime-dependencies.adoc +++ b/src/site/asciidoc/runtime-dependencies.adoc @@ -16,6 +16,10 @@ //// = Runtime Dependencies +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + Some Log4j features depend on external libraries. This page lists the required and optional dependencies. diff --git a/src/site/asciidoc/security.adoc b/src/site/asciidoc/security.adoc index 81c510e2ff..6fe1249aca 100644 --- a/src/site/asciidoc/security.adoc +++ b/src/site/asciidoc/security.adoc @@ -14,9 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. //// - = Apache Log4j Security Vulnerabilities +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + This page lists all the security vulnerabilities fixed in released versions of Apache Log4j 2. Each vulnerability is given a link:#Security_Impact_Levels[security impact rating] by the mailto:priv...@logging.apache.org[Apache Logging security team]. diff --git a/src/site/asciidoc/support.adoc b/src/site/asciidoc/support.adoc index 96401f6461..64b5cfe7b9 100644 --- a/src/site/asciidoc/support.adoc +++ b/src/site/asciidoc/support.adoc @@ -14,9 +14,12 @@ See the License for the specific language governing permissions and limitations under the License. //// - = Support +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + The Apache Software Foundation does not employ individuals to develop and support any of its projects. The individuals who contribute to Apache projects do it either as part of specific tasks assigned to them by their employer, on their own initiative to benefit their employer, or on their own free time. diff --git a/src/site/asciidoc/thanks.adoc b/src/site/asciidoc/thanks.adoc index 64620acccc..4af1bf87df 100644 --- a/src/site/asciidoc/thanks.adoc +++ b/src/site/asciidoc/thanks.adoc @@ -16,6 +16,10 @@ //// = Project Thanks +++++ +<link rel="stylesheet" type="text/css" href="../css/tables.css"> +++++ + Log4j 2 is a successful project because of the large and diverse community that contributes to it. diff --git a/src/site/markdown/log4j-spring-boot.md b/src/site/markdown/log4j-spring-boot.md index dc8a4eb30b..7d5bd0f839 100644 --- a/src/site/markdown/log4j-spring-boot.md +++ b/src/site/markdown/log4j-spring-boot.md @@ -18,7 +18,12 @@ # Log4j Spring Boot Support -This module provides enhanced support for Spring Boot beyond what Spring Boot itself provides. +This module provides enhanced support for Spring Boot beyond what Spring Boot 2.x itself provides. + + +> **Note:** This module is unnecessary with Spring Boot 3.0 as all the components documented here have been +integrated into Spring Boot. + ## Overview @@ -51,7 +56,7 @@ Log4j implementation to be chosen, would not be available. ### Spring Profile Arbiter -New with Log4j 2.15.0 are "Arbiters" which are conditionals that can cause a portion of the Log4j configuration to +"Arbiters" which are conditionals that can cause a portion of the Log4j configuration to be included or excluded. log4j-spring-boot provides an Arbiter that allows a Spring profile value to be used for this purpose. Below is an example: ``` @@ -82,6 +87,6 @@ this purpose. Below is an example: ## Requirements -The Log4j 2 Spring Cloud Configuration integration has a dependency on Log4j 2 API, Log4j 2 Core, and +The Log4j 3.x Spring Cloud Configuration integration has a dependency on Log4j 3.x API, Log4j 3.x Core, and Spring Boot versions 2.0.3.RELEASE or 2.1.1.RELEASE or later versions it either release series. For more information, see [Runtime Dependencies](runtime-dependencies.html). diff --git a/src/site/resources/css/asciidoctor-classic.css b/src/site/resources/css/asciidoctor-classic.css new file mode 100644 index 0000000000..8f94449eb0 --- /dev/null +++ b/src/site/resources/css/asciidoctor-classic.css @@ -0,0 +1,527 @@ +/* Shared CSS for AsciiDoc xhtml11 and html5 backends */ + +/* Default font. */ +body { + font-family: Georgia,serif; +} + +/* Title font. */ +h1, h2, h3, h4, h5, h6, +div.title, caption.title, +thead, p.table.header, +#toctitle, +#author, #revnumber, #revdate, #revremark, +#footer { + font-family: Arial,Helvetica,sans-serif; +} + +body { + margin: 1em 5% 1em 5%; +} + +a { + color: blue; + text-decoration: underline; +} +a:visited { + color: fuchsia; +} + +em { + font-style: italic; + color: navy; +} + +strong { + font-weight: bold; + color: #083194; +} + +h1, h2, h3, h4, h5, h6 { + color: #527bbd; + margin-top: 1.2em; + margin-bottom: 0.5em; + line-height: 1.3; +} + +h1, h2, h3 { + border-bottom: 2px solid silver; +} +h2 { + padding-top: 0.5em; +} +h3 { + float: left; +} +h3 + * { + clear: left; +} +h5 { + font-size: 1.0em; +} + +div.sectionbody { + margin-left: 0; +} + +hr { + border: 1px solid silver; +} + +p { + margin-top: 0.5em; + margin-bottom: 0.5em; +} + +ul, ol, li > p { + margin-top: 0; +} +ul > li { color: #aaa; } +ul > li > * { color: black; } + +.monospaced, code, pre { + font-family: "Courier New", Courier, monospace; + font-size: inherit; + color: navy; + padding: 0; + margin: 0; +} +pre { + white-space: pre-wrap; +} + +#author { + color: #527bbd; + font-weight: bold; + font-size: 1.1em; +} +#email { +} +#revnumber, #revdate, #revremark { +} + +#footer { + font-size: small; + border-top: 2px solid silver; + padding-top: 0.5em; + margin-top: 4.0em; +} +#footer-text { + float: left; + padding-bottom: 0.5em; +} +#footer-badges { + float: right; + padding-bottom: 0.5em; +} + +#preamble { + margin-top: 1.5em; + margin-bottom: 1.5em; +} +div.imageblock, div.exampleblock, div.verseblock, +div.quoteblock, div.literalblock, div.listingblock, div.sidebarblock, +div.admonitionblock { + margin-top: 1.0em; + margin-bottom: 1.5em; +} +div.admonitionblock { + margin-top: 2.0em; + margin-bottom: 2.0em; + margin-right: 10%; + color: #606060; +} + +div.content { /* Block element content. */ + padding: 0; +} + +/* Block element titles. */ +div.title, caption.title { + color: #527bbd; + font-weight: bold; + text-align: left; + margin-top: 1.0em; + margin-bottom: 0.5em; +} +div.title + * { + margin-top: 0; +} + +td div.title:first-child { + margin-top: 0.0em; +} +div.content div.title:first-child { + margin-top: 0.0em; +} +div.content + div.title { + margin-top: 0.0em; +} + +div.sidebarblock > div.content { + background: #ffffee; + border: 1px solid #dddddd; + border-left: 4px solid #f0f0f0; + padding: 0.5em; +} + +div.listingblock > div.content { + border: 1px solid #dddddd; + border-left: 5px solid #f0f0f0; + background: #f8f8f8; + padding: 0.5em; +} + +div.quoteblock, div.verseblock { + padding-left: 1.0em; + margin-left: 1.0em; + margin-right: 10%; + border-left: 5px solid #f0f0f0; + color: #888; +} + +div.quoteblock > div.attribution { + padding-top: 0.5em; + text-align: right; +} + +div.verseblock > pre.content { + font-family: inherit; + font-size: inherit; +} +div.verseblock > div.attribution { + padding-top: 0.75em; + text-align: left; +} +/* DEPRECATED: Pre version 8.2.7 verse style literal block. */ +div.verseblock + div.attribution { + text-align: left; +} + +div.admonitionblock .icon { + vertical-align: top; + font-size: 1.1em; + font-weight: bold; + text-decoration: underline; + color: #527bbd; + padding-right: 0.5em; +} +div.admonitionblock td.content { + padding-left: 0.5em; + border-left: 3px solid #dddddd; +} + +div.exampleblock > div.content { + border-left: 3px solid #dddddd; + padding-left: 0.5em; +} + +div.imageblock div.content { padding-left: 0; } +span.image img { border-style: none; vertical-align: text-bottom; } +a.image:visited { color: white; } + +dl { + margin-top: 0.8em; + margin-bottom: 0.8em; +} +dt { + margin-top: 0.5em; + margin-bottom: 0; + font-style: normal; + color: navy; +} +dd > *:first-child { + margin-top: 0.1em; +} + +ul, ol { + list-style-position: outside; +} +ol.arabic { + list-style-type: decimal; +} +ol.loweralpha { + list-style-type: lower-alpha; +} +ol.upperalpha { + list-style-type: upper-alpha; +} +ol.lowerroman { + list-style-type: lower-roman; +} +ol.upperroman { + list-style-type: upper-roman; +} + +div.compact ul, div.compact ol, +div.compact p, div.compact p, +div.compact div, div.compact div { + margin-top: 0.1em; + margin-bottom: 0.1em; +} + +tfoot { + font-weight: bold; +} +td > div.verse { + white-space: pre; +} + +div.hdlist { + margin-top: 0.8em; + margin-bottom: 0.8em; +} +div.hdlist tr { + padding-bottom: 15px; +} +dt.hdlist1.strong, td.hdlist1.strong { + font-weight: bold; +} +td.hdlist1 { + vertical-align: top; + font-style: normal; + padding-right: 0.8em; + color: navy; +} +td.hdlist2 { + vertical-align: top; +} +div.hdlist.compact tr { + margin: 0; + padding-bottom: 0; +} + +.comment { + background: yellow; +} + +.footnote, .footnoteref { + font-size: 0.8em; +} + +span.footnote, span.footnoteref { + vertical-align: super; +} + +#footnotes { + margin: 20px 0 20px 0; + padding: 7px 0 0 0; +} + +#footnotes div.footnote { + margin: 0 0 5px 0; +} + +#footnotes hr { + border: none; + border-top: 1px solid silver; + height: 1px; + text-align: left; + margin-left: 0; + width: 20%; + min-width: 100px; +} + +div.colist td { + padding-right: 0.5em; + padding-bottom: 0.3em; + vertical-align: top; +} +div.colist td img { + margin-top: 0.3em; +} + +@media print { + #footer-badges { display: none; } +} + +#toc { + margin-bottom: 2.5em; +} + +#toctitle { + color: #527bbd; + font-size: 1.1em; + font-weight: bold; + margin-top: 1.0em; + margin-bottom: 0.1em; +} + +div.toclevel0, div.toclevel1, div.toclevel2, div.toclevel3, div.toclevel4 { + margin-top: 0; + margin-bottom: 0; +} +div.toclevel2 { + margin-left: 2em; + font-size: 0.9em; +} +div.toclevel3 { + margin-left: 4em; + font-size: 0.9em; +} +div.toclevel4 { + margin-left: 6em; + font-size: 0.9em; +} + +span.aqua { color: aqua; } +span.black { color: black; } +span.blue { color: blue; } +span.fuchsia { color: fuchsia; } +span.gray { color: gray; } +span.green { color: green; } +span.lime { color: lime; } +span.maroon { color: maroon; } +span.navy { color: navy; } +span.olive { color: olive; } +span.purple { color: purple; } +span.red { color: red; } +span.silver { color: silver; } +span.teal { color: teal; } +span.white { color: white; } +span.yellow { color: yellow; } + +span.aqua-background { background: aqua; } +span.black-background { background: black; } +span.blue-background { background: blue; } +span.fuchsia-background { background: fuchsia; } +span.gray-background { background: gray; } +span.green-background { background: green; } +span.lime-background { background: lime; } +span.maroon-background { background: maroon; } +span.navy-background { background: navy; } +span.olive-background { background: olive; } +span.purple-background { background: purple; } +span.red-background { background: red; } +span.silver-background { background: silver; } +span.teal-background { background: teal; } +span.white-background { background: white; } +span.yellow-background { background: yellow; } + +span.big { font-size: 2em; } +span.small { font-size: 0.6em; } + +span.underline { text-decoration: underline; } +span.overline { text-decoration: overline; } +span.line-through { text-decoration: line-through; } + +div.unbreakable { page-break-inside: avoid; } + + +/* + * xhtml11 specific + * + * */ + +div.tableblock { + margin-top: 1.0em; + margin-bottom: 1.5em; +} +div.tableblock > table { + border: 3px solid #527bbd; +} +thead, p.table.header { + font-weight: bold; + color: #527bbd; +} +p.table { + margin-top: 0; +} +/* Because the table frame attribute is overriden by CSS in most browsers. */ +div.tableblock > table[frame="void"] { + border-style: none; +} +div.tableblock > table[frame="hsides"] { + border-left-style: none; + border-right-style: none; +} +div.tableblock > table[frame="vsides"] { + border-top-style: none; + border-bottom-style: none; +} + + +/* + * html5 specific + * + * */ + +table.tableblock { + margin-top: 1.0em; + margin-bottom: 1.5em; +} +thead, p.tableblock.header { + font-weight: bold; + color: #527bbd; +} +p.tableblock { + margin-top: 0; +} +table.tableblock { + border-width: 3px; + border-spacing: 0px; + border-style: solid; + border-color: #527bbd; + border-collapse: collapse; +} +th.tableblock, td.tableblock { + border-width: 1px; + padding: 4px; + border-style: solid; + border-color: #527bbd; +} + +table.tableblock.frame-topbot { + border-left-style: hidden; + border-right-style: hidden; +} +table.tableblock.frame-sides { + border-top-style: hidden; + border-bottom-style: hidden; +} +table.tableblock.frame-none { + border-style: hidden; +} + +th.tableblock.halign-left, td.tableblock.halign-left { + text-align: left; +} +th.tableblock.halign-center, td.tableblock.halign-center { + text-align: center; +} +th.tableblock.halign-right, td.tableblock.halign-right { + text-align: right; +} + +th.tableblock.valign-top, td.tableblock.valign-top { + vertical-align: top; +} +th.tableblock.valign-middle, td.tableblock.valign-middle { + vertical-align: middle; +} +th.tableblock.valign-bottom, td.tableblock.valign-bottom { + vertical-align: bottom; +} + + +/* + * manpage specific + * + * */ + +body.manpage h1 { + padding-top: 0.5em; + padding-bottom: 0.5em; + border-top: 2px solid silver; + border-bottom: 2px solid silver; +} +body.manpage h2 { + border-style: none; +} +body.manpage div.sectionbody { + margin-left: 3em; +} + +@media print { + body.manpage div#toc { display: none; } +} \ No newline at end of file diff --git a/src/site/resources/css/tables.css b/src/site/resources/css/tables.css new file mode 100644 index 0000000000..8e645385fe --- /dev/null +++ b/src/site/resources/css/tables.css @@ -0,0 +1,95 @@ + +/* + * xhtml11 specific + * + * */ + +div.tableblock { + margin-top: 1.0em; + margin-bottom: 1.5em; +} +div.tableblock > table { + border: 3px solid #527bbd; +} +thead, p.table.header { + font-weight: bold; + color: #527bbd; +} +p.table { + margin-top: 0; +} +/* Because the table frame attribute is overriden by CSS in most browsers. */ +div.tableblock > table[frame="void"] { + border-style: none; +} +div.tableblock > table[frame="hsides"] { + border-left-style: none; + border-right-style: none; +} +div.tableblock > table[frame="vsides"] { + border-top-style: none; + border-bottom-style: none; +} + + +/* + * html5 specific + * + * */ + +table.tableblock { + margin-top: 1.0em; + margin-bottom: 1.5em; +} +thead, p.tableblock.header { + font-weight: bold; + color: #527bbd; +} +p.tableblock { + margin-top: 0; +} +table.tableblock { + border-width: 3px; + border-spacing: 0px; + border-style: solid; + border-color: #527bbd; + border-collapse: collapse; +} +th.tableblock, td.tableblock { + border-width: 1px; + padding: 4px; + border-style: solid; + border-color: #527bbd; +} + +table.tableblock.frame-topbot { + border-left-style: hidden; + border-right-style: hidden; +} +table.tableblock.frame-sides { + border-top-style: hidden; + border-bottom-style: hidden; +} +table.tableblock.frame-none { + border-style: hidden; +} + +th.tableblock.halign-left, td.tableblock.halign-left { + text-align: left; +} +th.tableblock.halign-center, td.tableblock.halign-center { + text-align: center; +} +th.tableblock.halign-right, td.tableblock.halign-right { + text-align: right; +} + +th.tableblock.valign-top, td.tableblock.valign-top { + vertical-align: top; +} +th.tableblock.valign-middle, td.tableblock.valign-middle { + vertical-align: middle; +} +th.tableblock.valign-bottom, td.tableblock.valign-bottom { + vertical-align: bottom; +} diff --git a/src/site/resources/images/logo.png b/src/site/resources/images/logo.png index 5759868c8a..d84126b86b 100644 Binary files a/src/site/resources/images/logo.png and b/src/site/resources/images/logo.png differ diff --git a/src/site/site.xml b/src/site/site.xml index 83be154be3..e1a47661fc 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -25,7 +25,7 @@ </bannerLeft> <bannerRight> <src>images/logo.png</src> - <href>http://logging.apache.org/log4j/2.x</href> + <href>http://logging.apache.org/log4j/3.x</href> </bannerRight> <skin> <groupId>org.apache.maven.skins</groupId> @@ -41,7 +41,7 @@ <item name="GitHub" href="https://github.com/apache/logging-log4j2"/> </links> - <menu name="Apache Log4j™ 2" inherit="top" img="img/glyphicons/home.png"> + <menu name="Apache Log4j™ 3.x" inherit="top" img="img/glyphicons/home.png"> <item name="About" href="/index.html"/> <item name="Download" href="/download.html"/> <item name="Javadoc" href="/javadoc.html"/> @@ -326,6 +326,7 @@ <item name="Liquibase Binding" href="log4j-liquibase.html"/> <item name="Docker Support" href="log4j-docker.html"/> <item name="Kubernetes Support" href="log4j-kubernetes.html"/> + <item name="Log4j Spring Boot" href="log4j-spring-boot.html"/> <item name="Spring Cloud Config Client" href="log4j-spring-cloud-config-client.html"/> <item name="Log4j Transformation Tools" href="log4j-transform"/> </menu>