Package org.apache.logging.slf4j
Class Log4jMarkerFactory
- java.lang.Object
-
- org.apache.logging.slf4j.Log4jMarkerFactory
-
- All Implemented Interfaces:
org.slf4j.IMarkerFactory
public class Log4jMarkerFactory extends Object implements org.slf4j.IMarkerFactory
Log4j/SLF4J bridge to create SLF4J Markers based on name or based on existing SLF4J Markers.
-
-
Constructor Summary
Constructors Constructor Description Log4jMarkerFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandetachMarker(String name)Log4j does not support detached Markers.booleanexists(String name)Returns true if the Marker exists.org.slf4j.MarkergetDetachedMarker(String name)Log4j does not support detached Markers for performance reasons.org.slf4j.MarkergetMarker(String name)Returns a Log4j Marker that is compatible with SLF4J.org.slf4j.MarkergetMarker(org.slf4j.Marker marker)Returns a Log4j Marker converted from an existing custom SLF4J Marker.
-
-
-
Method Detail
-
getMarker
public org.slf4j.Marker getMarker(String name)
Returns a Log4j Marker that is compatible with SLF4J.- Specified by:
getMarkerin interfaceorg.slf4j.IMarkerFactory- Parameters:
name- The name of the Marker.- Returns:
- A Marker.
-
getMarker
public org.slf4j.Marker getMarker(org.slf4j.Marker marker)
Returns a Log4j Marker converted from an existing custom SLF4J Marker.- Parameters:
marker- The SLF4J Marker to convert.- Returns:
- A converted Log4j/SLF4J Marker.
- Since:
- 2.1
-
exists
public boolean exists(String name)
Returns true if the Marker exists.- Specified by:
existsin interfaceorg.slf4j.IMarkerFactory- Parameters:
name- The Marker name.- Returns:
trueif the Marker exists,falseotherwise.
-
detachMarker
public boolean detachMarker(String name)
Log4j does not support detached Markers. This method always returns false.- Specified by:
detachMarkerin interfaceorg.slf4j.IMarkerFactory- Parameters:
name- The Marker name.- Returns:
false
-
getDetachedMarker
public org.slf4j.Marker getDetachedMarker(String name)
Log4j does not support detached Markers for performance reasons. The returned Marker is attached.- Specified by:
getDetachedMarkerin interfaceorg.slf4j.IMarkerFactory- Parameters:
name- The Marker name.- Returns:
- The named Marker (unmodified).
-
-