Class Jdk13LumberjackLogger

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

public class Jdk13LumberjackLogger extends Object implements Log, Serializable
Implementation of the org.apache.commons.logging.Log interface that wraps the standard JDK logging mechanisms that are available in SourceForge's Lumberjack for JDKs prior to 1.4.
Since:
1.1
Version:
$Id: Jdk13LumberjackLogger.java 1432663 2013-01-13 17:24:18Z tn $
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      Serializable version identifier.
      See Also:
    • logger

      protected transient Logger logger
      The underlying Logger implementation we are using.
    • name

      protected String name
    • sourceClassName

      private String sourceClassName
    • sourceMethodName

      private String sourceMethodName
    • classAndMethodFound

      private boolean classAndMethodFound
    • dummyLevel

      protected static final Level dummyLevel
      This member variable simply ensures that any attempt to initialise this class in a pre-1.4 JVM will result in an ExceptionInInitializerError. It must not be private, as an optimising compiler could detect that it is not used and optimise it away.
  • Constructor Details

    • Jdk13LumberjackLogger

      public Jdk13LumberjackLogger(String name)
      Construct a named instance of this Logger.
      Parameters:
      name - Name of the logger to be constructed
  • Method Details

    • log

      private void log(Level level, String msg, Throwable ex)
    • getClassAndMethod

      private void getClassAndMethod()
      Gets the class and method by looking at the stack trace for the first entry that is not this class.
    • debug

      public void debug(Object message)
      Logs a message with java.util.logging.Level.FINE.
      Specified by:
      debug in interface Log
      Parameters:
      message - to log
      See Also:
    • debug

      public void debug(Object message, Throwable exception)
      Logs a message with java.util.logging.Level.FINE.
      Specified by:
      debug in interface Log
      Parameters:
      message - to log
      exception - log this cause
      See Also:
    • error

      public void error(Object message)
      Logs a message with java.util.logging.Level.SEVERE.
      Specified by:
      error in interface Log
      Parameters:
      message - to log
      See Also:
    • error

      public void error(Object message, Throwable exception)
      Logs a message with java.util.logging.Level.SEVERE.
      Specified by:
      error in interface Log
      Parameters:
      message - to log
      exception - log this cause
      See Also:
    • fatal

      public void fatal(Object message)
      Logs a message with java.util.logging.Level.SEVERE.
      Specified by:
      fatal in interface Log
      Parameters:
      message - to log
      See Also:
    • fatal

      public void fatal(Object message, Throwable exception)
      Logs a message with java.util.logging.Level.SEVERE.
      Specified by:
      fatal in interface Log
      Parameters:
      message - to log
      exception - log this cause
      See Also:
    • getLogger

      public Logger getLogger()
      Return the native Logger instance we are using.
    • info

      public void info(Object message)
      Logs a message with java.util.logging.Level.INFO.
      Specified by:
      info in interface Log
      Parameters:
      message - to log
      See Also:
    • info

      public void info(Object message, Throwable exception)
      Logs a message with java.util.logging.Level.INFO.
      Specified by:
      info in interface Log
      Parameters:
      message - to log
      exception - log this cause
      See Also:
    • isDebugEnabled

      public boolean isDebugEnabled()
      Is debug logging currently enabled?
      Specified by:
      isDebugEnabled in interface Log
      Returns:
      true if debug is enabled in the underlying logger.
    • isErrorEnabled

      public boolean isErrorEnabled()
      Is error logging currently enabled?
      Specified by:
      isErrorEnabled in interface Log
      Returns:
      true if error is enabled in the underlying logger.
    • isFatalEnabled

      public boolean isFatalEnabled()
      Is fatal logging currently enabled?
      Specified by:
      isFatalEnabled in interface Log
      Returns:
      true if fatal is enabled in the underlying logger.
    • isInfoEnabled

      public boolean isInfoEnabled()
      Is info logging currently enabled?
      Specified by:
      isInfoEnabled in interface Log
      Returns:
      true if info is enabled in the underlying logger.
    • isTraceEnabled

      public boolean isTraceEnabled()
      Is trace logging currently enabled?
      Specified by:
      isTraceEnabled in interface Log
      Returns:
      true if trace is enabled in the underlying logger.
    • isWarnEnabled

      public boolean isWarnEnabled()
      Is warn logging currently enabled?
      Specified by:
      isWarnEnabled in interface Log
      Returns:
      true if warn is enabled in the underlying logger.
    • trace

      public void trace(Object message)
      Logs a message with java.util.logging.Level.FINEST.
      Specified by:
      trace in interface Log
      Parameters:
      message - to log
      See Also:
    • trace

      public void trace(Object message, Throwable exception)
      Logs a message with java.util.logging.Level.FINEST.
      Specified by:
      trace in interface Log
      Parameters:
      message - to log
      exception - log this cause
      See Also:
    • warn

      public void warn(Object message)
      Logs a message with java.util.logging.Level.WARNING.
      Specified by:
      warn in interface Log
      Parameters:
      message - to log
      See Also:
    • warn

      public void warn(Object message, Throwable exception)
      Logs a message with java.util.logging.Level.WARNING.
      Specified by:
      warn in interface Log
      Parameters:
      message - to log
      exception - log this cause
      See Also: