Class Reload4jLoggerAdapter

All Implemented Interfaces:
Serializable, Logger, LocationAwareLogger, LoggingEventAware

A wrapper over org.apache.log4j.Logger conforming to the Logger interface.

Note that the logging levels mentioned in this class refer to those defined in the org.apache.log4j.Level class.

This class is a copy-and-paste of Log4j12LoggerAdapter from the slf4j-log4j12 module.

Since:
2.0.0-alpha6
Author:
Ceki Gülcü
See Also:
  • Method Details

    • isTraceEnabled

      public boolean isTraceEnabled()
      Is this logger instance enabled for the TRACE level?
      Specified by:
      isTraceEnabled in interface Logger
      Returns:
      True if this Logger is enabled for level TRACE, false otherwise.
    • isDebugEnabled

      public boolean isDebugEnabled()
      Is this logger instance enabled for the DEBUG level?
      Specified by:
      isDebugEnabled in interface Logger
      Returns:
      True if this Logger is enabled for level DEBUG, false otherwise.
    • isInfoEnabled

      public boolean isInfoEnabled()
      Is this logger instance enabled for the INFO level?
      Specified by:
      isInfoEnabled in interface Logger
      Returns:
      True if this Logger is enabled for the INFO level, false otherwise.
    • isWarnEnabled

      public boolean isWarnEnabled()
      Is this logger instance enabled for the WARN level?
      Specified by:
      isWarnEnabled in interface Logger
      Returns:
      True if this Logger is enabled for the WARN level, false otherwise.
    • isErrorEnabled

      public boolean isErrorEnabled()
      Is this logger instance enabled for level ERROR?
      Specified by:
      isErrorEnabled in interface Logger
      Returns:
      True if this Logger is enabled for level ERROR, false otherwise.
    • log

      public void log(Marker marker, String callerFQCN, int level, String msg, Object[] arguments, Throwable t)
      Description copied from interface: LocationAwareLogger
      Printing method with support for location information.
      Specified by:
      log in interface LocationAwareLogger
      Parameters:
      marker - The marker to be used for this event, may be null.
      callerFQCN - The fully qualified class name of the logger instance, typically the logger class, logger bridge or a logger wrapper.
      level - One of the level integers defined in this interface
      msg - The message for the log event
      t - Throwable associated with the log event, may be null.
    • handleNormalizedLoggingCall

      protected void handleNormalizedLoggingCall(Level level, Marker marker, String msg, Object[] arguments, Throwable throwable)
      Description copied from class: AbstractLogger
      Given various arguments passed as parameters, perform actual logging.

      This method assumes that the separation of the args array into actual objects and a throwable has been already operated.

      Specified by:
      handleNormalizedLoggingCall in class AbstractLogger
      Parameters:
      level - the SLF4J level for this event
      marker - The marker to be used for this event, may be null.
      msg - The message pattern which will be parsed and formatted
      arguments - the array of arguments to be formatted, may be null
      throwable - The exception whose stack trace should be logged, may be null
    • log

      public void log(LoggingEvent event)
      Called by SubstituteLogger or by LoggingEventBuilder instances
      Specified by:
      log in interface LoggingEventAware
      Parameters:
      event -
    • getFullyQualifiedCallerName

      Specified by:
      getFullyQualifiedCallerName in class AbstractLogger