This is an automated email from the ASF dual-hosted git repository.
ckozak 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 cb18f36 LOG4J2-3133: log4j-slf4j-impl provides new singleton
accessors from slf4j-api 1.7.14
cb18f36 is described below
commit cb18f36d762154fafd6edfb5c0838ad7d877561e
Author: Carter Kozak <[email protected]>
AuthorDate: Wed Aug 4 10:34:13 2021 -0400
LOG4J2-3133: log4j-slf4j-impl provides new singleton accessors from
slf4j-api 1.7.14
See
https://github.com/qos-ch/slf4j/commit/ea3cca72cd5a9329a06b788317a17e806ee8acd0
and https://jira.qos.ch/browse/SLF4J-347
---
.../src/main/java/org/slf4j/impl/StaticMDCBinder.java | 9 +++++++++
.../src/main/java/org/slf4j/impl/StaticMarkerBinder.java | 9 +++++++++
src/changes/changes.xml | 5 +++++
3 files changed, 23 insertions(+)
diff --git a/log4j-slf4j-impl/src/main/java/org/slf4j/impl/StaticMDCBinder.java
b/log4j-slf4j-impl/src/main/java/org/slf4j/impl/StaticMDCBinder.java
index c6e395d..eb46620 100644
--- a/log4j-slf4j-impl/src/main/java/org/slf4j/impl/StaticMDCBinder.java
+++ b/log4j-slf4j-impl/src/main/java/org/slf4j/impl/StaticMDCBinder.java
@@ -33,6 +33,15 @@ public final class StaticMDCBinder {
}
/**
+ * Returns the {@link #SINGLETON} {@link StaticMDCBinder}.
+ * Added to slf4j-api 1.7.14 via
https://github.com/qos-ch/slf4j/commit/ea3cca72cd5a9329a06b788317a17e806ee8acd0
+ * @return the singleton instance
+ */
+ public static StaticMDCBinder getSingleton() {
+ return SINGLETON;
+ }
+
+ /**
* Currently this method always returns an instance of {@link
StaticMDCBinder}.
* @return an MDC adapter
*/
diff --git
a/log4j-slf4j-impl/src/main/java/org/slf4j/impl/StaticMarkerBinder.java
b/log4j-slf4j-impl/src/main/java/org/slf4j/impl/StaticMarkerBinder.java
index e255120..35091ac 100644
--- a/log4j-slf4j-impl/src/main/java/org/slf4j/impl/StaticMarkerBinder.java
+++ b/log4j-slf4j-impl/src/main/java/org/slf4j/impl/StaticMarkerBinder.java
@@ -33,6 +33,15 @@ public class StaticMarkerBinder implements
MarkerFactoryBinder {
private final IMarkerFactory markerFactory = new Log4jMarkerFactory();
+ /**
+ * Returns the {@link #SINGLETON} {@link StaticMarkerBinder}.
+ * Added to slf4j-api 1.7.14 via
https://github.com/qos-ch/slf4j/commit/ea3cca72cd5a9329a06b788317a17e806ee8acd0
+ * @return the singleton instance
+ */
+ public static StaticMarkerBinder getSingleton() {
+ return SINGLETON;
+ }
+
@Override
public IMarkerFactory getMarkerFactory() {
return markerFactory;
diff --git a/src/changes/changes.xml b/src/changes/changes.xml
index e5d41a9..3d100c8 100644
--- a/src/changes/changes.xml
+++ b/src/changes/changes.xml
@@ -31,6 +31,11 @@
-->
<release version="2.15.0" date="2021-MM-DD" description="GA Release
2.15.0">
<!-- ADDS -->
+ <action issue="LOG4J2-3133" dev="ckozak" type="add">
+ Add missing slf4j-api singleton accessors to log4j-slf4j-impl (1.7)
StaticMarkerBinder and StaticMDCBinder.
+ This doesn't impact behavior or correctness, but avoids throwing and
catching NoSuchMethodErrors when slf4j
+ is initialized and avoids linkage linting warnings.
+ </action>
<action issue="LOG4J2-2885" dev="vy" type="add" due-to="Markus Spann">
Add support for US-style date patterns and micro/nano seconds to
FixedDateTime.
</action>