@@ -31,10 +31,10 @@ <h2>SLF4J user manual</h2>
31
31
32
32
< p > The Simple Logging Facade for Java (SLF4J) serves as a simple
33
33
facade or abstraction for various logging frameworks, such as
34
- java.util.logging, logback and log4j . SLF4J allows the end-user to
35
- plug in the desired logging framework at < em > deployment</ em > time.
36
- Note that SLF4J-enabling your library/application implies the
37
- addition of only a single mandatory dependency, namely
34
+ java.util.logging, logback and reload4j . SLF4J allows the end-user
35
+ to plug in the desired logging framework at < em > deployment</ em >
36
+ time. Note that SLF4J-enabling your library/application implies
37
+ the addition of only a single mandatory dependency, namely
38
38
< em > slf4j-api-${project.version}.jar</ em > .</ p >
39
39
40
40
< p > < span class ="label "> since 1.6.0</ span > If no binding is found on the
@@ -271,12 +271,14 @@ <h3 class="doAnchor" name="swapping">Binding with a logging
271
271
</ dt >
272
272
< dd > Binding/provider for < a
273
273
href ="http://logging.apache.org/log4j/1.2/index.html "> log4j
274
- version 1.2</ a > , a widely used logging framework. You also
275
- need to place < em > log4j.jar</ em > on your class path. < span
276
- class ="red "> Assuming you wish to continue to use the log4j 1.x
277
- framework, given that the log4j 1.x has reached EOL status, we
278
- strongly encourage you to use < em > slf4j-reload4j</ em >
279
- instead.</ span > See below.
274
+ version 1.2</ a > , a widely used logging framework. < span
275
+ class ="red "> Given that log4j 1.x has been declared EOL in 2015
276
+ and again in 2022, as of SLF4J 1.7.35, the < em > slf4j-log4j
277
+ module</ em > automatically redirects to the
278
+ < em > slf4j-reload4j</ em > module at < b > build time</ b > .</ span >
279
+ Assuming you wish to continue to use the log4j 1.x framework,
280
+ we strongly encourage you to use < code > slf4j-reload4j</ code >
281
+ instead. See below.
280
282
< p />
281
283
282
284
</ dd >
@@ -445,13 +447,14 @@ <h3 class="doAnchor" name="projectDep">Declaring project
445
447
you need to do is to declare "ch.qos.logback:logback-classic" as
446
448
a dependency in your < em > pom.xml</ em > file as shown below. In
447
449
addition to < em > logback-classic-${logback.version}.jar</ em > ,
448
- this will pull < em > slf4j-api-${latest.stable.version}.jar</ em > as well
449
- as < em > logback-core-${logback.version}.jar</ em > into your
450
+ this will pull in
451
+ < em > slf4j-api-${latest.stable.version}.jar</ em > as well as
452
+ < em > logback-core-${logback.version}.jar</ em > into your
450
453
project. Note that explicitly declaring a dependency on
451
454
< em > logback-core-${logback.version}</ em > or
452
- < em > slf4j-api-${latest.stable.version}.jar</ em > is not wrong and may
453
- be necessary to impose the correct version of said artifacts by
454
- virtue of Maven's "nearest definition" dependency mediation
455
+ < em > slf4j-api-${latest.stable.version}.jar</ em > is not wrong and
456
+ may be necessary to impose the correct version of said artifacts
457
+ by virtue of Maven's "nearest definition" dependency mediation
455
458
rule.
456
459
</ p >
457
460
@@ -465,19 +468,18 @@ <h3 class="doAnchor" name="projectDep">Declaring project
465
468
466
469
<!-- ================================== -->
467
470
< p > < span class ="label notice "> reload4j</ span > If you wish to use
468
- reload4j as the underlying logging framework, all you need to do is
469
- to declare "org.slf4j:slf4j-reload4j" as a dependency in your
470
- < em > pom.xml</ em > file as shown below. In addition to
471
- < em > slf4j-reload4j-${latest.stable.version}.jar</ em > , this will pull
472
- < em > slf4j-api-${latest.stable.version}.jar</ em > as well as
473
- < em > reload4j-${reload4j.version}.jar</ em > into your project. Note
474
- that explicitly declaring a dependency on
475
- < em > reload4j-${reload4j.version}.jar</ em > or
476
- < em > slf4j-api-${latest.stable.version}.jar</ em > is not wrong and may
477
- be necessary to impose the correct version of said artifacts by
478
- virtue of Maven's "nearest definition" dependency mediation
479
- rule.</ p >
480
-
471
+ reload4j as the underlying logging framework, all you need to do
472
+ is to declare "org.slf4j:slf4j-reload4j" as a dependency in your
473
+ < em > pom.xml</ em > file as shown below. In addition to
474
+ < em > slf4j-reload4j-${latest.stable.version}.jar</ em > , this will
475
+ pull in < em > slf4j-api-${latest.stable.version}.jar</ em > as well
476
+ as < em > reload4j-${reload4j.version}.jar</ em > into your project.
477
+ Note that explicitly declaring a dependency on
478
+ < em > reload4j-${reload4j.version}.jar</ em > or
479
+ < em > slf4j-api-${latest.stable.version}.jar</ em > is not wrong and
480
+ may be necessary to impose the correct version of said artifacts
481
+ by virtue of Maven's "nearest definition" dependency mediation
482
+ rule.</ p >
481
483
482
484
< pre class ="prettyprint source "> <dependency>
483
485
<groupId> org.slf4j</groupId>
@@ -488,19 +490,10 @@ <h3 class="doAnchor" name="projectDep">Declaring project
488
490
489
491
<!-- ================================== -->
490
492
491
- < p > < span class ="label notice "> log4j</ span > If you wish to use
492
- log4j as the underlying logging framework, all you need to do is
493
- to declare "org.slf4j:slf4j-log4j12" as a dependency in your
494
- < em > pom.xml</ em > file as shown below. In addition to
495
- < em > slf4j-log4j12-${latest.stable.version}.jar</ em > , this will pull
496
- < em > slf4j-api-${latest.stable.version}.jar</ em > as well as
497
- < em > log4j-${log4j.version}.jar</ em > into your project. Note
498
- that explicitly declaring a dependency on
499
- < em > log4j-${log4j.version}.jar</ em > or
500
- < em > slf4j-api-${latest.stable.version}.jar</ em > is not wrong and may
501
- be necessary to impose the correct version of said artifacts by
502
- virtue of Maven's "nearest definition" dependency mediation
503
- rule.</ p >
493
+ < p > < span class ="label notice "> log4j</ span > As of version 1.7.35,
494
+ declaring a dependency on < code > org.slf4j:slf4j-log4j12</ code >
495
+ redirects to < code > org.slf4j:slf4j-reload4j</ code > by virtue of
496
+ Maven <relocation> directive. </ p >
504
497
505
498
< pre class ="prettyprint source "> <dependency>
506
499
<groupId> org.slf4j</groupId>
@@ -517,12 +510,12 @@ <h3 class="doAnchor" name="projectDep">Declaring project
517
510
framework, all you need to do is to declare
518
511
"org.slf4j:slf4j-jdk14" as a dependency in your < em > pom.xml</ em >
519
512
file as shown below. In addition to
520
- < em > slf4j-jdk14-${latest.stable.version}.jar</ em > , this will pull
521
- < em > slf4j-api-${latest.stable.version}.jar</ em > into your project.
522
- Note that explicitly declaring a dependency on
523
- < em > slf4j-api-${latest.stable.version}.jar</ em > is not wrong and may
524
- be necessary to impose the correct version of said artifact by
525
- virtue of Maven's "nearest definition" dependency mediation
513
+ < em > slf4j-jdk14-${latest.stable.version}.jar</ em > , this will
514
+ pull in < em > slf4j-api-${latest.stable.version}.jar</ em > into
515
+ your project. Note that explicitly declaring a dependency on
516
+ < em > slf4j-api-${latest.stable.version}.jar</ em > is not wrong and
517
+ may be necessary to impose the correct version of said artifact
518
+ by virtue of Maven's "nearest definition" dependency mediation
526
519
rule.</ p >
527
520
528
521
< pre class ="prettyprint source "> <dependency>
0 commit comments