Class Log4JLogger

java.lang.Object
org.apache.avalon.framework.logger.Log4JLogger
All Implemented Interfaces:
org.apache.avalon.framework.logger.Logger

public final class Log4JLogger extends Object implements org.apache.avalon.framework.logger.Logger
The default Log4J wrapper class for Logger.
Version:
$Id: Log4JLogger.java 30977 2004-07-30 03:57:54 -0500 (Fri, 30 Jul 2004) niclas $
Author:
Avalon Development Team
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final String
    Constant for name of class to use when recording caller of log method.
    private final org.apache.log4j.Logger
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Log4JLogger(org.apache.log4j.Logger logImpl)
    Create a logger that delegates to specified category.
  • Method Summary

    Modifier and Type
    Method
    Description
    final void
    debug(String message)
    Log a debug message.
    final void
    debug(String message, Throwable throwable)
    Log a debug message.
    final void
    error(String message)
    Log a error message.
    final void
    error(String message, Throwable throwable)
    Log a error message.
    final void
    fatalError(String message)
    Log a fatalError message.
    final void
    fatalError(String message, Throwable throwable)
    Log a fatalError message.
    final org.apache.avalon.framework.logger.Logger
    Create a new child logger.
    final void
    info(String message)
    Log a info message.
    final void
    info(String message, Throwable throwable)
    Log a info message.
    final boolean
    Determine if messages of priority "debug" will be logged.
    final boolean
    Determine if messages of priority "error" will be logged.
    final boolean
    Determine if messages of priority "fatalError" will be logged.
    final boolean
    Determine if messages of priority "info" will be logged.
    final boolean
    Determine if messages of priority "warn" will be logged.
    final void
    warn(String message)
    Log a warn message.
    final void
    warn(String message, Throwable throwable)
    Log a warn message.

    Methods inherited from class java.lang.Object

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

    • FQCN

      private static final String FQCN
      Constant for name of class to use when recording caller of log method.
    • m_logger

      private final org.apache.log4j.Logger m_logger
  • Constructor Details

    • Log4JLogger

      public Log4JLogger(org.apache.log4j.Logger logImpl)
      Create a logger that delegates to specified category.
      Parameters:
      logImpl - the category to delegate to
  • Method Details

    • debug

      public final void debug(String message)
      Log a debug message.
      Specified by:
      debug in interface org.apache.avalon.framework.logger.Logger
      Parameters:
      message - the message
    • debug

      public final void debug(String message, Throwable throwable)
      Log a debug message.
      Specified by:
      debug in interface org.apache.avalon.framework.logger.Logger
      Parameters:
      message - the message
      throwable - the throwable
    • isDebugEnabled

      public final boolean isDebugEnabled()
      Determine if messages of priority "debug" will be logged.
      Specified by:
      isDebugEnabled in interface org.apache.avalon.framework.logger.Logger
      Returns:
      true if "debug" messages will be logged
    • info

      public final void info(String message)
      Log a info message.
      Specified by:
      info in interface org.apache.avalon.framework.logger.Logger
      Parameters:
      message - the message
    • info

      public final void info(String message, Throwable throwable)
      Log a info message.
      Specified by:
      info in interface org.apache.avalon.framework.logger.Logger
      Parameters:
      message - the message
      throwable - the throwable
    • isInfoEnabled

      public final boolean isInfoEnabled()
      Determine if messages of priority "info" will be logged.
      Specified by:
      isInfoEnabled in interface org.apache.avalon.framework.logger.Logger
      Returns:
      true if "info" messages will be logged
    • warn

      public final void warn(String message)
      Log a warn message.
      Specified by:
      warn in interface org.apache.avalon.framework.logger.Logger
      Parameters:
      message - the message
    • warn

      public final void warn(String message, Throwable throwable)
      Log a warn message.
      Specified by:
      warn in interface org.apache.avalon.framework.logger.Logger
      Parameters:
      message - the message
      throwable - the throwable
    • isWarnEnabled

      public final boolean isWarnEnabled()
      Determine if messages of priority "warn" will be logged.
      Specified by:
      isWarnEnabled in interface org.apache.avalon.framework.logger.Logger
      Returns:
      true if "warn" messages will be logged
    • error

      public final void error(String message)
      Log a error message.
      Specified by:
      error in interface org.apache.avalon.framework.logger.Logger
      Parameters:
      message - the message
    • error

      public final void error(String message, Throwable throwable)
      Log a error message.
      Specified by:
      error in interface org.apache.avalon.framework.logger.Logger
      Parameters:
      message - the message
      throwable - the throwable
    • isErrorEnabled

      public final boolean isErrorEnabled()
      Determine if messages of priority "error" will be logged.
      Specified by:
      isErrorEnabled in interface org.apache.avalon.framework.logger.Logger
      Returns:
      true if "error" messages will be logged
    • fatalError

      public final void fatalError(String message)
      Log a fatalError message.
      Specified by:
      fatalError in interface org.apache.avalon.framework.logger.Logger
      Parameters:
      message - the message
    • fatalError

      public final void fatalError(String message, Throwable throwable)
      Log a fatalError message.
      Specified by:
      fatalError in interface org.apache.avalon.framework.logger.Logger
      Parameters:
      message - the message
      throwable - the throwable
    • isFatalErrorEnabled

      public final boolean isFatalErrorEnabled()
      Determine if messages of priority "fatalError" will be logged.
      Specified by:
      isFatalErrorEnabled in interface org.apache.avalon.framework.logger.Logger
      Returns:
      true if "fatalError" messages will be logged
    • getChildLogger

      public final org.apache.avalon.framework.logger.Logger getChildLogger(String name)
      Create a new child logger. The name of the child logger is [current-loggers-name].[passed-in-name] Throws IllegalArgumentException if name has an empty element name
      Specified by:
      getChildLogger in interface org.apache.avalon.framework.logger.Logger
      Parameters:
      name - the subname of this logger
      Returns:
      the new logger