Class Log4JLogger

java.lang.Object
org.apache.commons.logging.impl.Log4JLogger
All Implemented Interfaces:
Serializable, Log

@Deprecated public class Log4JLogger extends Object implements Log, Serializable
Deprecated.
Scheduled for removal since version 1.x of Log4j has reached end-of-life.
Implements Log to map directly to a Logger for Apache Log4J version 1.2.

Initial configuration of the corresponding Logger instances should be done in the usual manner, as outlined in the Log4J documentation.

The reason this logger is distinct from the 1.3.0 logger is that in version 1.2 of Log4J:

  • class Logger takes Priority parameters not Level parameters.
  • class Level extends Priority
Log4j 1.3 is expected to change Level so it no longer extends Priority, which is a non-binary-compatible change. The class generated by compiling this code against Log4j 1.2 will therefore not run against Log4j 1.3.
See Also:
  • Constructor Summary

    Constructors
    Constructor
    Description
    Deprecated.
    Constructs a new instance.
    Deprecated.
    Base constructor.
    Log4JLogger(org.apache.log4j.Logger logger)
    Deprecated.
    For use with a Log4j factory.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    debug(Object message)
    Deprecated.
    Logs a message with org.apache.log4j.Priority.DEBUG.
    void
    debug(Object message, Throwable t)
    Deprecated.
    Logs a message with org.apache.log4j.Priority.DEBUG.
    void
    error(Object message)
    Deprecated.
    Logs a message with org.apache.log4j.Priority.ERROR.
    void
    error(Object message, Throwable t)
    Deprecated.
    Logs a message with org.apache.log4j.Priority.ERROR.
    void
    fatal(Object message)
    Deprecated.
    Logs a message with org.apache.log4j.Priority.FATAL.
    void
    fatal(Object message, Throwable t)
    Deprecated.
    Logs a message with org.apache.log4j.Priority.FATAL.
    org.apache.log4j.Logger
    Deprecated.
    Gets the native Logger instance we are using.
    void
    info(Object message)
    Deprecated.
    Logs a message with org.apache.log4j.Priority.INFO.
    void
    info(Object message, Throwable t)
    Deprecated.
    Logs a message with org.apache.log4j.Priority.INFO.
    boolean
    Deprecated.
    Tests whether the Log4j Logger used is enabled for DEBUG priority.
    boolean
    Deprecated.
    Tests whether the Log4j Logger used is enabled for ERROR priority.
    boolean
    Deprecated.
    Tests whether the Log4j Logger used is enabled for FATAL priority.
    boolean
    Deprecated.
    Tests whether the Log4j Logger used is enabled for INFO priority.
    boolean
    Deprecated.
    Tests whether the Log4j Logger used is enabled for TRACE priority.
    boolean
    Deprecated.
    Tests whether the Log4j Logger used is enabled for WARN priority.
    void
    trace(Object message)
    Deprecated.
    Logs a message with org.apache.log4j.Priority.TRACE.
    void
    trace(Object message, Throwable t)
    Deprecated.
    Logs a message with org.apache.log4j.Priority.TRACE.
    void
    warn(Object message)
    Deprecated.
    Logs a message with org.apache.log4j.Priority.WARN.
    void
    warn(Object message, Throwable t)
    Deprecated.
    Logs a message with org.apache.log4j.Priority.WARN.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Log4JLogger

      public Log4JLogger()
      Deprecated.
      Constructs a new instance.
    • Log4JLogger

      public Log4JLogger(org.apache.log4j.Logger logger)
      Deprecated.
      For use with a Log4j factory.
      Parameters:
      logger - Logger.
    • Log4JLogger

      public Log4JLogger(String name)
      Deprecated.
      Base constructor.
      Parameters:
      name - name.
  • Method Details

    • debug

      public void debug(Object message)
      Deprecated.
      Logs a message with org.apache.log4j.Priority.DEBUG.
      Specified by:
      debug in interface Log
      Parameters:
      message - to log
      See Also:
    • debug

      public void debug(Object message, Throwable t)
      Deprecated.
      Logs a message with org.apache.log4j.Priority.DEBUG.
      Specified by:
      debug in interface Log
      Parameters:
      message - to log
      t - log this cause
      See Also:
    • error

      public void error(Object message)
      Deprecated.
      Logs a message with org.apache.log4j.Priority.ERROR.
      Specified by:
      error in interface Log
      Parameters:
      message - to log
      See Also:
    • error

      public void error(Object message, Throwable t)
      Deprecated.
      Logs a message with org.apache.log4j.Priority.ERROR.
      Specified by:
      error in interface Log
      Parameters:
      message - to log
      t - log this cause
      See Also:
    • fatal

      public void fatal(Object message)
      Deprecated.
      Logs a message with org.apache.log4j.Priority.FATAL.
      Specified by:
      fatal in interface Log
      Parameters:
      message - to log
      See Also:
    • fatal

      public void fatal(Object message, Throwable t)
      Deprecated.
      Logs a message with org.apache.log4j.Priority.FATAL.
      Specified by:
      fatal in interface Log
      Parameters:
      message - to log
      t - log this cause
      See Also:
    • getLogger

      public org.apache.log4j.Logger getLogger()
      Deprecated.
      Gets the native Logger instance we are using.
      Returns:
      the native Logger instance we are using.
    • info

      public void info(Object message)
      Deprecated.
      Logs a message with org.apache.log4j.Priority.INFO.
      Specified by:
      info in interface Log
      Parameters:
      message - to log
      See Also:
    • info

      public void info(Object message, Throwable t)
      Deprecated.
      Logs a message with org.apache.log4j.Priority.INFO.
      Specified by:
      info in interface Log
      Parameters:
      message - to log
      t - log this cause
      See Also:
    • isDebugEnabled

      public boolean isDebugEnabled()
      Deprecated.
      Tests whether the Log4j Logger used is enabled for DEBUG priority.
      Specified by:
      isDebugEnabled in interface Log
      Returns:
      true if debug is enabled in the underlying logger.
    • isErrorEnabled

      public boolean isErrorEnabled()
      Deprecated.
      Tests whether the Log4j Logger used is enabled for ERROR priority.
      Specified by:
      isErrorEnabled in interface Log
      Returns:
      true if error is enabled in the underlying logger.
    • isFatalEnabled

      public boolean isFatalEnabled()
      Deprecated.
      Tests whether the Log4j Logger used is enabled for FATAL priority.
      Specified by:
      isFatalEnabled in interface Log
      Returns:
      true if fatal is enabled in the underlying logger.
    • isInfoEnabled

      public boolean isInfoEnabled()
      Deprecated.
      Tests whether the Log4j Logger used is enabled for INFO priority.
      Specified by:
      isInfoEnabled in interface Log
      Returns:
      true if info is enabled in the underlying logger.
    • isTraceEnabled

      public boolean isTraceEnabled()
      Deprecated.
      Tests whether the Log4j Logger used is enabled for TRACE priority. When using a Log4j version that does not support the TRACE level, this call will report whether DEBUG is enabled or not.
      Specified by:
      isTraceEnabled in interface Log
      Returns:
      true if trace is enabled in the underlying logger.
    • isWarnEnabled

      public boolean isWarnEnabled()
      Deprecated.
      Tests whether the Log4j Logger used is enabled for WARN priority.
      Specified by:
      isWarnEnabled in interface Log
      Returns:
      true if warn is enabled in the underlying logger.
    • trace

      public void trace(Object message)
      Deprecated.
      Logs a message with org.apache.log4j.Priority.TRACE. When using a Log4j version that does not support the TRACE level, the message will be logged at the DEBUG level.
      Specified by:
      trace in interface Log
      Parameters:
      message - to log
      See Also:
    • trace

      public void trace(Object message, Throwable t)
      Deprecated.
      Logs a message with org.apache.log4j.Priority.TRACE. When using a Log4j version that does not support the TRACE level, the message will be logged at the DEBUG level.
      Specified by:
      trace in interface Log
      Parameters:
      message - to log
      t - log this cause
      See Also:
    • warn

      public void warn(Object message)
      Deprecated.
      Logs a message with org.apache.log4j.Priority.WARN.
      Specified by:
      warn in interface Log
      Parameters:
      message - to log
      See Also:
    • warn

      public void warn(Object message, Throwable t)
      Deprecated.
      Logs a message with org.apache.log4j.Priority.WARN.
      Specified by:
      warn in interface Log
      Parameters:
      message - to log
      t - log this cause
      See Also: