Package org.apache.logging.log4j
Class MarkerManager
java.lang.Object
org.apache.logging.log4j.MarkerManager
Applications create Markers by using the Marker Manager. All Markers created by this Manager are immutable.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Consider this class private, it is only public to satisfy Jackson for XML and JSON IO. -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
clear()
Clears all markers.static boolean
Tests existence of the given marker.static Marker
Retrieves a Marker or create a Marker that has no parent.static Marker
Deprecated.Use the Marker add or set methods to add parent Markers.static Marker
Deprecated.Use the Marker add or set methods to add parent Markers.private static void
requireNonNull
(Object obj, String message)
-
Field Details
-
MARKERS
-
-
Constructor Details
-
MarkerManager
private MarkerManager()
-
-
Method Details
-
clear
public static void clear()Clears all markers. -
exists
Tests existence of the given marker.- Parameters:
key
- the marker name- Returns:
- true if the marker exists.
- Since:
- 2.4
-
getMarker
Retrieves a Marker or create a Marker that has no parent.- Parameters:
name
- The name of the Marker.- Returns:
- The Marker with the specified name.
- Throws:
IllegalArgumentException
- if the argument isnull
-
getMarker
Deprecated.Use the Marker add or set methods to add parent Markers. Will be removed by final GA release.Retrieves or creates a Marker with the specified parent. The parent must have been previously created.- Parameters:
name
- The name of the Marker.parent
- The name of the parent Marker.- Returns:
- The Marker with the specified name.
- Throws:
IllegalArgumentException
- if the parent Marker does not exist.
-
getMarker
Deprecated.Use the Marker add or set methods to add parent Markers. Will be removed by final GA release.Retrieves or creates a Marker with the specified parent.- Parameters:
name
- The name of the Marker.parent
- The parent Marker.- Returns:
- The Marker with the specified name.
- Throws:
IllegalArgumentException
- if any argument isnull
-
requireNonNull
-