You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@logging.apache.org by rg...@apache.org on 2019/11/18 06:31:23 UTC

[logging-log4j2] branch release-2.x updated: LOG4J2-63 - Add documentation

This is an automated email from the ASF dual-hosted git repository.

rgoers pushed a commit to branch release-2.x
in repository https://gitbox.apache.org/repos/asf/logging-log4j2.git


The following commit(s) were added to refs/heads/release-2.x by this push:
     new 2922d4b  LOG4J2-63 - Add documentation
2922d4b is described below

commit 2922d4b681a3cc4ab2a17d3f2f9572a02d1316b7
Author: Ralph Goers <rg...@apache.org>
AuthorDate: Sun Nov 17 23:31:02 2019 -0700

    LOG4J2-63 - Add documentation
---
 .../log4j/core/config/ConfigurationFactory.java    |  2 +-
 src/site/markdown/index.md.vm                      |  9 +++--
 src/site/markdown/manual/cloud.md                  |  9 +++++
 src/site/markdown/manual/compatibility.md          | 44 ++++++++++++++++++++++
 src/site/site.xml                                  |  1 +
 5 files changed, 60 insertions(+), 5 deletions(-)

diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
index 9aba1c6..28a1d67 100644
--- a/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
+++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/config/ConfigurationFactory.java
@@ -93,7 +93,7 @@ public abstract class ConfigurationFactory extends ConfigurationBuilderFactory {
 
     public static final String LOG4J1_CONFIGURATION_FILE_PROPERTY = "log4j.configuration";
 
-    public static final String LOG4J1_EXPERIMENTAL = "log4j1.experimental";
+    public static final String LOG4J1_EXPERIMENTAL = "log4j1.compatibility";
 
     public static final String AUTHORIZATION_PROVIDER = "log4j2.authorizationProvider";
 
diff --git a/src/site/markdown/index.md.vm b/src/site/markdown/index.md.vm
index 5b7a9f7..156e540 100644
--- a/src/site/markdown/index.md.vm
+++ b/src/site/markdown/index.md.vm
@@ -109,13 +109,14 @@ garbage in web applications. This reduces pressure on the garbage collector and
 
 $h3 Integrating with Application Servers
 
-Version 2.10.0 introduces a the module log4j-appserver to improve integration with Apache Tomcat and Eclipse Jetty.
+Version 2.10.0 added the module log4j-appserver to improve integration with Apache Tomcat and Eclipse Jetty.
 
 $h3 Cloud Enabled
 
-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. See [Logging in the Cloud](manual/cloud.html)
-for details.
+Version 2.12.0 introduced 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 [Logging in the Cloud](manual/cloud.html) for details.
 
 $h2 Documentation
 
diff --git a/src/site/markdown/manual/cloud.md b/src/site/markdown/manual/cloud.md
index 0dd0d17..e48d985 100644
--- a/src/site/markdown/manual/cloud.md
+++ b/src/site/markdown/manual/cloud.md
@@ -224,6 +224,15 @@ REST endpoints will be lost if Log4j reconfigures itself do to changes in the lo
 Further information regarding integration of the log4j-spring-cloud-config-client can be found at 
 [Log4j Spring Cloud Config Client](../log4j-spring-cloud-config/log4j-spring-cloud-config-client/index.html).
 
+## Integration with Spring Boot
+
+Log4j integrates with Spring Boot in 2 ways:
+
+1. A Spring Lookup can be used to access the Spring application configuration from Log4j configuration files.
+1. Log4j will access the Spring configuration when it is trying to resolve log4j system properties.
+
+Both of these require that the log4j-spring-cloud-client jar is included in the application.
+
 ## Integration with Docker
 
 Applications within a Docker container that log using a Docker logging driver can include special 
diff --git a/src/site/markdown/manual/compatibility.md b/src/site/markdown/manual/compatibility.md
new file mode 100644
index 0000000..df0d728
--- /dev/null
+++ b/src/site/markdown/manual/compatibility.md
@@ -0,0 +1,44 @@
+<!-- vim: set syn=markdown : -->
+<!--
+ 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.
+-->
+
+# Log4j 2 Compatibility with Log4j 1
+
+## API Compatibility
+
+Log4j 2 provides support for the Log4j 1 logging methods by providing alternate implementations 
+of the classes containing those methods. These classes may be found in the log4j-1.2-api jar 
+distributed with the project. All calls to perform logging will result in the data passed to the logging methods
+to be forwarded to the Log4j2 API where they can be processed by implementations of the Log4j 2 API. 
+
+## Configuration Compatibility
+
+Log4j 2 provides experimental support for Log4j 1 configuration files. Configuration of the Appenders, Layouts 
+and Filters that were provided in the Log4j 1 distribution will be redirected to their Log4j 2 counterparts. 
+This means that although the while the behavior of these components will be similar they may not be exactly the
+same. For example, the XML generated by the XMLLayout may not exactly match the XML generated by the Log4j 1
+XMLLayout. 
+
+In addition, Log4j 2 supports custom Log4j 1 Appenders, Filters, and Layouts with some constraints. Since the 
+original Log4j 1 components are not present in Log4j 2 custom components that extend them will fail. 
+
+As support for Log4j 1 is an experimental feature one of the following steps must be taken to enable it:
+
+1. Set the system property "log4j1.compatibility" to a value of "true". Log4j 2 will then add log4j.properties,
+log4j-test.properties, log4j.xml and log4j-test.xml to the configuration files it searches for on the class path.
+1. Set the Log4j 1 system property "log4j.configuration" to the location of the log4j 1 configuration file. The 
+files must have a file extension of either ".properties" or ".xml".
\ No newline at end of file
diff --git a/src/site/site.xml b/src/site/site.xml
index 5df63df..4d3b8c2 100644
--- a/src/site/site.xml
+++ b/src/site/site.xml
@@ -87,6 +87,7 @@
     <menu name="Manual" inherit="top" img="img/glyphicons/book.png">
       <item name="Introduction" href="/manual/index.html"/>
       <item name="Architecture" href="/manual/architecture.html"/>
+      <item name="Log4j 1.x Compatibility" href="manual/compatibility.html"/>
       <item name="Log4j 1.x Migration" href="manual/migration.html"/>
 
       <item name="Java API" href="/manual/api.html" collapse="true">