org.apache.logging.log4j

Class MarkerManager



  • public final class MarkerManager
    extends Object
    Applications create Markers by using the Marker Manager. All Markers created by this Manager are immutable.
    • Method Detail

      • clear

        public static void clear()
        Clears all markers.
      • exists

        public static boolean exists(String key)
        Tests existence of the given marker.
        Parameters:
        key - the marker name
        Returns:
        true if the marker exists.
        Since:
        2.4
      • getMarker

        public static Marker getMarker(String name)
        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 is null
      • getMarker

        @Deprecated
        public static Marker getMarker(String name,
                                                   String parent)
        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
        public static Marker getMarker(String name,
                                                   Marker parent)
        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 is null

Copyright © 1999-2023 The Apache Software Foundation. All Rights Reserved.
Apache Logging, Apache Log4j, Log4j, Apache, the Apache feather logo, the Apache Logging project logo, and the Apache Log4j logo are trademarks of The Apache Software Foundation.