Remove support for Log4j
Apache Log4j 1.x is EOL and has now been replaced by log4j 2. This commit removes the deprecated support for Log4j 1.x See gh-4905
This commit is contained in:
@@ -1313,12 +1313,11 @@ You also need to add `logging.file` to your `application.properties`:
|
||||
|
||||
[[howto-configure-log4j-for-logging]]
|
||||
=== Configure Log4j for logging
|
||||
Spring Boot also supports either http://logging.apache.org/log4j/1.2[Log4j] or
|
||||
http://logging.apache.org/log4j/2.x[Log4j 2] for logging configuration, but only if one
|
||||
of them is on the classpath. If you are using the starter poms for assembling
|
||||
dependencies that means you have to exclude Logback and then include your chosen version
|
||||
of Log4j instead. If you aren't using the starter poms then you need to provide
|
||||
`commons-logging` (at least) in addition to your chosen version of Log4j.
|
||||
Spring Boot supports http://logging.apache.org/log4j/2.x[Log4j 2] for logging
|
||||
configuration if it is on the classpath. If you are using the starter poms for
|
||||
assembling dependencies that means you have to exclude Logback and then include log4j 2
|
||||
instead. If you aren't using the starter poms then you need to provide `commons-logging`
|
||||
(at least) in addition to Log4j 2.
|
||||
|
||||
The simplest path is probably through the starter poms, even though it requires some
|
||||
jiggling with excludes, .e.g. in Maven:
|
||||
@@ -1341,17 +1340,14 @@ jiggling with excludes, .e.g. in Maven:
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-log4j</artifactId>
|
||||
<artifactId>spring-boot-starter-log4j2</artifactId>
|
||||
</dependency>
|
||||
----
|
||||
|
||||
To use Log4j 2, simply depend on `spring-boot-starter-log4j2` rather than
|
||||
`spring-boot-starter-log4j`.
|
||||
|
||||
NOTE: The use of one of the Log4j starters gathers together the dependencies for
|
||||
common logging requirements (e.g. including having Tomcat use `java.util.logging` but
|
||||
configuring the output using Log4j or Log4j 2). See the Actuator Log4j or Log4j 2
|
||||
samples for more detail and to see it in action.
|
||||
NOTE: The use of the Log4j starters gathers together the dependencies for common logging
|
||||
requirements (e.g. including having Tomcat use `java.util.logging` but configuring the
|
||||
output using Log4j 2). See the Actuator Log4j 2 samples for more detail and to see it in
|
||||
action.
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -983,9 +983,9 @@ Spring Boot uses http://commons.apache.org/logging[Commons Logging] for all inte
|
||||
logging, but leaves the underlying log implementation open. Default configurations are
|
||||
provided for
|
||||
http://docs.oracle.com/javase/7/docs/api/java/util/logging/package-summary.html[Java Util Logging],
|
||||
http://logging.apache.org/log4j/[Log4J], http://logging.apache.org/log4j/2.x/[Log4J2] and
|
||||
http://logback.qos.ch/[Logback]. In each case loggers are pre-configured to use console
|
||||
output with optional file output also available.
|
||||
http://logging.apache.org/log4j/2.x/[Log4J2] andhttp://logback.qos.ch/[Logback]. In each
|
||||
case loggers are pre-configured to use console output with optional file output also
|
||||
available.
|
||||
|
||||
By default, If you use the '`Starter POMs`', Logback will be used for logging. Appropriate
|
||||
Logback routing is also included to ensure that dependent libraries that use
|
||||
@@ -1182,9 +1182,6 @@ Depending on your logging system, the following files will be loaded:
|
||||
|Logback
|
||||
|`logback-spring.xml`, `logback-spring.groovy`, `logback.xml` or `logback.groovy`
|
||||
|
||||
|Log4j
|
||||
|`log4j-spring.properties`, `log4j-spring.xml`, `log4j.properties` or `log4j.xml`
|
||||
|
||||
|Log4j2
|
||||
|`log4j2-spring.xml` or `log4j2.xml`
|
||||
|
||||
|
||||
@@ -517,8 +517,8 @@ swap specific technical facets.
|
||||
|`spring-boot-starter-jetty`
|
||||
|Imports the Jetty HTTP engine (to be used as an alternative to Tomcat).
|
||||
|
||||
|`spring-boot-starter-log4j`
|
||||
|Support the Log4J logging framework.
|
||||
|`spring-boot-starter-log4j2`
|
||||
|Support the Log4J 2 logging framework.
|
||||
|
||||
|`spring-boot-starter-logging`
|
||||
|Import Spring Boot's default logging framework (Logback).
|
||||
|
||||
Reference in New Issue
Block a user