Frequently Asked Questions about SLF4J
+Frequently Asked Questions about SLF4J
Generalities
@@ -190,7 +190,7 @@Frequently Asked Questions about SLF4J
Generalities
-
-
- What is SLF4J? +
- What is SLF4J?
-
SLF4J is a simple facade for logging systems allowing the end-user to plug in the desired logging system at deployment @@ -198,7 +198,7 @@
Generalities
- - When should SLF4J be used? +
- When should SLF4J be used?
-
In short, libraries and other embedded components should @@ -243,7 +243,7 @@
Generalities
- - Is SLF4J yet
+
- Is SLF4J yet another logging facade?
-
@@ -257,7 +257,7 @@
Generalities
- - If SLF4J fixes JCL,
+
- If SLF4J fixes JCL, then why wasn't the fix made in JCL instead of creating a new project?
@@ -288,7 +288,7 @@Generalities
-- When using SLF4J, do +
- When using SLF4J, do I have to recompile my application to switch to a different logging system?
@@ -312,7 +312,7 @@Generalities
-- What are SLF4J's +
- What are SLF4J's requirements?
@@ -360,7 +360,7 @@Generalities
-- +
- What has changed in SLF4J version 2.0.0?
@@ -446,7 +446,7 @@Generalities
-- Are SLF4J versions +
- Are SLF4J versions backward compatible?
@@ -483,7 +483,7 @@Generalities
-- I am getting +
- I am getting
@@ -535,7 +535,7 @@IllegalAccessError
exceptions when using SLF4J. Why is that?Generalities
-- Why is SLF4J licensed under +
- Why is SLF4J licensed under X11 type license instead of the Apache Software License?
@@ -553,7 +553,7 @@Generalities
-- Where can I get a +
- Where can I get a particular SLF4J provider/binding?
@@ -581,7 +581,7 @@Generalities
-- Should my library +
- Should my library attempt to configure logging?
@@ -602,7 +602,7 @@Generalities
-- In order to reduce +
- In order to reduce the number of dependencies of our software we would like to make SLF4J an optional dependency. Is that a good idea?
@@ -696,7 +696,7 @@Generalities
-- What about Maven transitive +
- What about Maven transitive dependencies?
@@ -743,7 +743,7 @@Generalities
-- How do I exclude +
- How do I exclude commons-logging as a Maven dependency?
@@ -870,7 +870,7 @@Generalities
-- What are the JPMS +
- What are the JPMS module names of the various SLF4J artifacts?
@@ -926,7 +926,7 @@About the SLF4J API
- Why don't the
+
- Why don't the printing methods in the Logger interface accept message of type Object, but only messages of type String?
@@ -983,7 +983,7 @@About the SLF4J API
-- Can I log an +
- Can I log an exception without an accompanying message?
@@ -1041,7 +1041,7 @@About the SLF4J API
-- What is the +
- What is the fastest way of (not) logging?
@@ -1188,7 +1188,7 @@About the SLF4J API
-- How can I log the +
- How can I log the string contents of a single (possibly complex) object?
-
@@ -1218,7 +1218,7 @@
About the SLF4J API
- - Why doesn't the
+
- Why doesn't the
@@ -1280,7 +1280,7 @@org.slf4j.Logger
interface have methods for the FATAL level?About the SLF4J API
-- Why was the TRACE level +
- Why was the TRACE level introduced only in SLF4J version 1.4.0?
- Why doesn't the
-
@@ -1325,7 +1325,7 @@
About the SLF4J API
- - Does the SLF4J logging API
+
- Does the SLF4J logging API support I18N (internationalization)?
@@ -1341,7 +1341,7 @@About the SLF4J API
-- Is it possible to +
- Is it possible to retrieve loggers without going through the static methods in
@@ -1374,7 +1374,7 @@LoggerFactory
?About the SLF4J API
-- In the presence of an +
- In the presence of an exception/throwable, is it possible to parameterize a logging statement?
@@ -1422,7 +1422,7 @@Implementing the SLF4J API
-- How do I make my +
- How do I make my logging framework SLF4J compatible?
@@ -1483,7 +1483,7 @@Implementing the SLF4J API
-- How can my logging +
- How can my logging system add support for the
Marker
interface? -
@@ -1517,7 +1517,7 @@
Implementing the SLF4J API
- - How does SLF4J's
+
- How does SLF4J's version check mechanism work?
@@ -1574,7 +1574,7 @@General questions about logging
- Should Logger members
+
- Should Logger members of a class be declared as static?
-
@@ -1739,7 +1739,7 @@
Explanation
-
-
- Is there a
+
- Is there a recommended idiom for declaring a logger in a class?
diff --git a/src/site/pages/legacy.html b/src/site/pages/legacy.html index 59a3e67..c64e299 100644 --- a/src/site/pages/legacy.html +++ b/src/site/pages/legacy.html @@ -44,10 +44,10 @@Bridging legacy APIs
Gradual migration to +
Gradual migration to SLF4J from Jakarta Commons Logging (JCL)
-jcl-over-slf4j.jar
+jcl-over-slf4j.jar
To ease migration to SLF4J from JCL, SLF4J distributions include the jar file jcl-over-slf4j.jar. This jar file is @@ -72,7 +72,7 @@
jcl-over-slf4j.jar
class loader issues related to commons logging. -slf4j-jcl.jar
+slf4j-jcl.jar
Some of our users after having switched to SLF4J API realize that in some contexts the use of JCL is mandatory and their use of SLF4J @@ -87,7 +87,7 @@
slf4j-jcl.jar
jcl-over-slf4j.jar should not be + id="jclRecursion">jcl-over-slf4j.jar should not be confused with slf4j-jcl.jar
@@ -117,7 +117,7 @@slf4j-jcl.jar
-log4j-over-slf4j
+log4j-over-slf4j
SLF4J ship with a module called log4j-over-slf4j. It allows log4j users to migrate existing applications to SLF4J without @@ -126,7 +126,7 @@
log4j-over-slf4j
described below. -How does it work?
+How does it work?
The log4j-over-slf4j module contains replacements of most widely used log4j classes, namely
org.apache.log4j.Category
, @@ -156,7 +156,7 @@How does it work?
href="http://logback.qos.ch/manual/index.html">its manual. -When does it not work?
+When does it not work?
The log4j-over-slf4j module will not work when the application calls log4j components that are not present in the @@ -170,7 +170,7 @@
When does it not work?
-What about the +
What about the overhead?
The overhead of using log4j-over-slf4j instead of log4j @@ -187,7 +187,7 @@
What about the -
log4j-over-slf4j.jar +
log4j-over-slf4j.jar and slf4j-reload4j.jar cannot be present simultaneously
@@ -217,7 +217,7 @@log4j-over-slf4j.jar -
jul-to-slf4j bridge
+jul-to-slf4j bridge
The jul-to-slf4j.jar artifact includes a java.util.logging (jul) handler, namely @@ -257,7 +257,7 @@
jul-to-slf4j bridge
-jul-to-slf4j.jar and slf4j-jdk14.jar cannot be present +
jul-to-slf4j.jar and slf4j-jdk14.jar cannot be present simultaneously
diff --git a/src/site/pages/log4shell.html b/src/site/pages/log4shell.html index 0471bd2..b6b90d6 100644 --- a/src/site/pages/log4shell.html +++ b/src/site/pages/log4shell.html @@ -184,7 +184,7 @@Does a similar vulnerability exist in logback?
LOGBACK-1591/CVE-2021-42550 are of different severity levels. -Additional protective +
Additional protective measure: write protect log4j{1,2}/logback configuration files
diff --git a/src/site/pages/manual.html b/src/site/pages/manual.html index 42093fb..46e5147 100644 --- a/src/site/pages/manual.html +++ b/src/site/pages/manual.html @@ -26,13 +26,13 @@SLF4J user manual
the addition of only a single mandatory dependency, namely slf4j-api-${latest.stable.version}.jar. -Where are the Maven coordinates?
+Where are the Maven coordinates?
At this time if you are only interested in obtaining the coordinates for using SLF4J API with a logging backend, you can jump to the relevant section.
-Salient historical changes
+Salient historical changes
since 1.6.0 If no binding is found on the class path, then SLF4J will default to a no-operation @@ -79,7 +79,7 @@
Salient historical changes
details. -Hello World
+Hello World
As customary in programming tradition, here is an example illustrating the simplest way to output "Hello world" using SLF4J. @@ -135,7 +135,7 @@
Hello World
0 [main] INFO HelloWorld - Hello World
-Typical usage +
Typical usage pattern
The sample code below illustrates the typical usage pattern @@ -169,7 +169,7 @@
Typical usage 21: } -
Fluent Logging API
+Fluent Logging API
since 2.0.0 SLF4J API version 2.0.0 requires Java 8 and introduces a backward-compatible @@ -262,7 +262,7 @@
Fluent Logging API
customizable behaviour. -Binding with a logging +
Binding with a logging framework at deployment time
As mentioned previously, SLF4J supports various logging @@ -401,7 +401,7 @@
Binding with a logging find it very easy to write SLF4J bindings. -
Libraries
+Libraries
Authors of widely-distributed components and libraries may code against the SLF4J interface in order to avoid imposing a @@ -447,7 +447,7 @@
Libraries
href="faq.html#optional_dependency">dependency reduction and testing. -Declaring project +
Declaring project dependencies for logging
Given Maven's transitive dependency rules, for "regular" @@ -616,7 +616,7 @@
Declaring project -
Binary +
Binary compatibility
An SLF4J binding designates an artifact such as @@ -658,7 +658,7 @@
Binary a warning about the suspected mismatch. -
Consolidate logging via +
Consolidate logging via SLF4J
Often times, a given project will depend on various @@ -672,7 +672,7 @@
Consolidate logging via APIs. -
Support for JDK Platform Logging (JEP 264) +
Support for JDK Platform Logging (JEP 264) SLF4J
Since 2.0.0-alpha5 The @@ -688,7 +688,7 @@
Support for JDK Platform Logging (JEP 264) -
Mapped Diagnostic Context (MDC) support
+Mapped Diagnostic Context (MDC) support
"Mapped Diagnostic Context" is essentially a map maintained by the logging framework where the application code provides @@ -718,7 +718,7 @@
Mapped Diagnostic Context (MDC) support
-Executive summary
+Executive summary
- Is there a
+
-
-
-
-