Class SLF4JLogBuilder

java.lang.Object
org.apache.logging.slf4j.SLF4JLogBuilder
All Implemented Interfaces:
LogBuilder

public class SLF4JLogBuilder extends Object implements LogBuilder
  • Field Details

    • EMPTY_MESSAGE

      private static Message EMPTY_MESSAGE
    • FQCN

      private static final String FQCN
    • LOGGER

      private static final Logger LOGGER
    • logger

      private ExtendedLogger logger
    • level

      private Level level
    • marker

      private Marker marker
    • throwable

      private Throwable throwable
    • inUse

      private volatile boolean inUse
    • threadId

      private final long threadId
  • Constructor Details

    • SLF4JLogBuilder

      public SLF4JLogBuilder(SLF4JLogger logger, Level level)
    • SLF4JLogBuilder

      public SLF4JLogBuilder()
  • Method Details

    • reset

      public LogBuilder reset(SLF4JLogger logger, Level level)
    • isInUse

      public boolean isInUse()
    • isValid

      private boolean isValid()
    • logMessage

      private void logMessage(Message message)
    • withMarker

      public LogBuilder withMarker(Marker marker)
      Description copied from interface: LogBuilder
      Includes a Marker in the log event. Interface default method does nothing.
      Specified by:
      withMarker in interface LogBuilder
      Parameters:
      marker - The Marker to log.
      Returns:
      The LogBuilder.
    • withThrowable

      public LogBuilder withThrowable(Throwable throwable)
      Description copied from interface: LogBuilder
      Includes a Throwable in the log event. Interface default method does nothing.
      Specified by:
      withThrowable in interface LogBuilder
      Parameters:
      throwable - The Throwable to log.
      Returns:
      the LogBuilder.
    • withLocation

      public LogBuilder withLocation()
      Description copied from interface: LogBuilder
      An implementation will calculate the caller's stack frame and include it in the log event. Interface default method does nothing.
      Specified by:
      withLocation in interface LogBuilder
      Returns:
      The LogBuilder.
    • withLocation

      public LogBuilder withLocation(StackTraceElement location)
      Description copied from interface: LogBuilder
      Adds the specified stack trace element to the log event. Interface default method does nothing.
      Specified by:
      withLocation in interface LogBuilder
      Parameters:
      location - The stack trace element to include in the log event.
      Returns:
      The LogBuilder.
    • log

      public void log(CharSequence message)
      Description copied from interface: LogBuilder
      Causes all the data collected to be logged along with the message. Interface default method does nothing.
      Specified by:
      log in interface LogBuilder
      Parameters:
      message - The message to log.
    • log

      public void log(String message)
      Description copied from interface: LogBuilder
      Causes all the data collected to be logged along with the message. Interface default method does nothing.
      Specified by:
      log in interface LogBuilder
      Parameters:
      message - The message to log.
    • log

      public void log(String message, Object... params)
      Description copied from interface: LogBuilder
      Logs a message with parameters. Interface default method does nothing.
      Specified by:
      log in interface LogBuilder
      Parameters:
      message - the message to log; the format depends on the message factory.
      params - parameters to the message.
      See Also:
    • log

      public void log(String message, Supplier<?>... params)
      Description copied from interface: LogBuilder
      Causes all the data collected to be logged along with the message and parameters. Interface default method does nothing.
      Specified by:
      log in interface LogBuilder
      Parameters:
      message - The message.
      params - Parameters to the message.
    • log

      public void log(Message message)
      Description copied from interface: LogBuilder
      Causes all the data collected to be logged along with the message. Interface default method does nothing.
      Specified by:
      log in interface LogBuilder
      Parameters:
      message - The message to log.
    • log

      public void log(Supplier<Message> messageSupplier)
      Description copied from interface: LogBuilder
      Causes all the data collected to be logged along with the message. Interface default method does nothing.
      Specified by:
      log in interface LogBuilder
      Parameters:
      messageSupplier - The supplier of the message to log.
    • logAndGet

      public Message logAndGet(Supplier<Message> messageSupplier)
      Description copied from interface: LogBuilder
      Causes all the data collected to be logged along with the message.
      Specified by:
      logAndGet in interface LogBuilder
      Parameters:
      messageSupplier - The supplier of the message to log.
      Returns:
      the message logger or null if no logging occurred.
    • log

      public void log(Object message)
      Description copied from interface: LogBuilder
      Causes all the data collected to be logged along with the message. Interface default method does nothing.
      Specified by:
      log in interface LogBuilder
      Parameters:
      message - The message to log.
    • log

      public void log(String message, Object p0)
      Description copied from interface: LogBuilder
      Logs a message with parameters. Interface default method does nothing.
      Specified by:
      log in interface LogBuilder
      Parameters:
      message - the message to log; the format depends on the message factory.
      p0 - parameter to the message.
      See Also:
    • log

      public void log(String message, Object p0, Object p1)
      Description copied from interface: LogBuilder
      Logs a message with parameters. Interface default method does nothing.
      Specified by:
      log in interface LogBuilder
      Parameters:
      message - the message to log; the format depends on the message factory.
      p0 - parameter to the message.
      p1 - parameter to the message.
      See Also:
    • log

      public void log(String message, Object p0, Object p1, Object p2)
      Description copied from interface: LogBuilder
      Logs a message with parameters. Interface default method does nothing.
      Specified by:
      log in interface LogBuilder
      Parameters:
      message - the message to log; the format depends on the message factory.
      p0 - parameter to the message.
      p1 - parameter to the message.
      p2 - parameter to the message.
      See Also:
    • log

      public void log(String message, Object p0, Object p1, Object p2, Object p3)
      Description copied from interface: LogBuilder
      Logs a message with parameters. Interface default method does nothing.
      Specified by:
      log in interface LogBuilder
      Parameters:
      message - the message to log; the format depends on the message factory.
      p0 - parameter to the message.
      p1 - parameter to the message.
      p2 - parameter to the message.
      p3 - parameter to the message.
      See Also:
    • log

      public void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4)
      Description copied from interface: LogBuilder
      Logs a message with parameters. Interface default method does nothing.
      Specified by:
      log in interface LogBuilder
      Parameters:
      message - the message to log; the format depends on the message factory.
      p0 - parameter to the message.
      p1 - parameter to the message.
      p2 - parameter to the message.
      p3 - parameter to the message.
      p4 - parameter to the message.
      See Also:
    • log

      public void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5)
      Description copied from interface: LogBuilder
      Logs a message with parameters. Interface default method does nothing.
      Specified by:
      log in interface LogBuilder
      Parameters:
      message - the message to log; the format depends on the message factory.
      p0 - parameter to the message.
      p1 - parameter to the message.
      p2 - parameter to the message.
      p3 - parameter to the message.
      p4 - parameter to the message.
      p5 - parameter to the message.
      See Also:
    • log

      public void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6)
      Description copied from interface: LogBuilder
      Logs a message with parameters.
      Specified by:
      log in interface LogBuilder
      Parameters:
      message - the message to log; the format depends on the message factory.
      p0 - parameter to the message.
      p1 - parameter to the message.
      p2 - parameter to the message.
      p3 - parameter to the message.
      p4 - parameter to the message.
      p5 - parameter to the message.
      p6 - parameter to the message.
      See Also:
    • log

      public void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7)
      Description copied from interface: LogBuilder
      Logs a message with parameters. Interface default method does nothing.
      Specified by:
      log in interface LogBuilder
      Parameters:
      message - the message to log; the format depends on the message factory.
      p0 - parameter to the message.
      p1 - parameter to the message.
      p2 - parameter to the message.
      p3 - parameter to the message.
      p4 - parameter to the message.
      p5 - parameter to the message.
      p6 - parameter to the message.
      p7 - parameter to the message.
      See Also:
    • log

      public void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8)
      Description copied from interface: LogBuilder
      Logs a message with parameters. Interface default method does nothing.
      Specified by:
      log in interface LogBuilder
      Parameters:
      message - the message to log; the format depends on the message factory.
      p0 - parameter to the message.
      p1 - parameter to the message.
      p2 - parameter to the message.
      p3 - parameter to the message.
      p4 - parameter to the message.
      p5 - parameter to the message.
      p6 - parameter to the message.
      p7 - parameter to the message.
      p8 - parameter to the message.
      See Also:
    • log

      public void log(String message, Object p0, Object p1, Object p2, Object p3, Object p4, Object p5, Object p6, Object p7, Object p8, Object p9)
      Description copied from interface: LogBuilder
      Logs a message with parameters. Interface default method does nothing.
      Specified by:
      log in interface LogBuilder
      Parameters:
      message - the message to log; the format depends on the message factory.
      p0 - parameter to the message.
      p1 - parameter to the message.
      p2 - parameter to the message.
      p3 - parameter to the message.
      p4 - parameter to the message.
      p5 - parameter to the message.
      p6 - parameter to the message.
      p7 - parameter to the message.
      p8 - parameter to the message.
      p9 - parameter to the message.
      See Also:
    • log

      public void log()
      Description copied from interface: LogBuilder
      Causes all the data collected to be logged. Default implementatoin does nothing.
      Specified by:
      log in interface LogBuilder