org.apache.logging.slf4j

Class 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 Detail

      • Log4jMarkerFactory

        public Log4jMarkerFactory()
    • Method Detail

      • getMarker

        public org.slf4j.Marker getMarker(String name)
        Returns a Log4j Marker that is compatible with SLF4J.
        Specified by:
        getMarker in interface org.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:
        exists in interface org.slf4j.IMarkerFactory
        Parameters:
        name - The Marker name.
        Returns:
        true if the Marker exists, false otherwise.
      • detachMarker

        public boolean detachMarker(String name)
        Log4j does not support detached Markers. This method always returns false.
        Specified by:
        detachMarker in interface org.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:
        getDetachedMarker in interface org.slf4j.IMarkerFactory
        Parameters:
        name - The Marker name.
        Returns:
        The named Marker (unmodified).

Copyright © 1999-2018 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.