@@ -395,8 +395,8 @@ Although Spring provides integration and support for a huge range of enterprise
395
395
other external tools, it intentionally keeps its mandatory dependencies to an absolute
396
396
minimum: you shouldn't have to locate and download (even automatically) a large number
397
397
of jar libraries in order to use Spring for simple use cases. For basic dependency
398
- injection there is only one mandatory external dependency, and that is for logging (see
399
- below for a more detailed description of logging options).
398
+ injection there is only one mandatory external dependency, and that is for logging
399
+ (see below for a more detailed description of logging options).
400
400
401
401
Next we outline the basic steps needed to configure an application that depends on
402
402
Spring, first with Maven and then with Gradle and finally using Ivy. In all cases, if
@@ -597,11 +597,12 @@ http://repo.spring.io/snapshot/org/springframework/spring[snapshots].
597
597
==== Logging
598
598
Spring's logging setup has been revised for Spring 5: It is still based on the Apache
599
599
Commons Logging API, also known as Jakarta Commons Logging (JCL). However, `spring-core`
600
- includes an embedded variant of Commons Logging now, with a Spring-specific `LogFactory`
601
- which automatically bridges to https://logging.apache.org/log4j/2.x/[Log4j 2],
602
- http://www.slf4j.org[SLF4J], or the JDK's own `java.util.logging` (JUL). This
603
- implementation acts like the JCL-over-SLF4J bridge but with a range of dynamically
604
- detected providers, analogous to JBoss Logging's common targets (as used by Hibernate).
600
+ refers to a custom Commons Logging bridge in the `spring-jcl` module now, with a
601
+ Spring-specific `LogFactory` implementation which automatically bridges to
602
+ https://logging.apache.org/log4j/2.x/[Log4j 2], http://www.slf4j.org[SLF4J], or the
603
+ JDK's own `java.util.logging` (JUL). This implementation acts like the JCL-over-SLF4J
604
+ bridge but with a range of dynamically detected providers, analogous to JBoss Logging's
605
+ common targets (as supported by e.g. Hibernate and Undertow).
605
606
606
607
As a benefit, there is no need for external bridges like JCL-over-SLF4J anymore,
607
608
and correspondingly no need for a manual exclude of the standard Commons Logging jar
@@ -630,6 +631,10 @@ up since Spring's bridge does not support custom `commons-logging.properties' se
630
631
For any other log provider, please set up a corresponding SLF4J or JUL bridge (which
631
632
you are very likely going to need for other libraries such as Hibernate anyway).
632
633
Note that Log4j 1.x has reached its end-of-life; please migrate to Log4j 2.x.
634
+
635
+ If you run into any remaining issues with Spring's Commons Logging implementation,
636
+ consider excluding `spring-jcl` and switching to the standard `commons-logging`
637
+ artifact (supporting `commons-logging.properties' setup) or to `jcl-over-slf4j`.
633
638
====
634
639
635
640
[[overview-logging-log4j]]
0 commit comments