org.apache.ojb.broker.util.logging
Class CommonsLoggerImpl

java.lang.Object
  extended byorg.apache.ojb.broker.util.logging.CommonsLoggerImpl
All Implemented Interfaces:
org.apache.ojb.broker.util.configuration.Configurable, Logger, java.io.Serializable

public class CommonsLoggerImpl
extends java.lang.Object
implements Logger

This is a Logger implementation based on jakarta commons logging. It can be enabled by putting LoggerClass=org.apache.ojb.broker.util.logging.CommonsLoggerImpl in the OJB .properties file.

Version:
$Id: CommonsLoggerImpl.java,v 1.4 2004/05/22 10:03:02 brj Exp $
Author:
Jakob Braeuchi
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.apache.ojb.broker.util.logging.Logger
DEBUG, ERROR, FATAL, INFO, serialVersionUID, WARN
 
Constructor Summary
CommonsLoggerImpl(java.lang.String aName)
          Constructor for CommonsLoggerImpl.
 
Method Summary
 void configure(org.apache.ojb.broker.util.configuration.Configuration config)
          Configure this logging.
 void debug(java.lang.Object pObject)
          generate a message for loglevel DEBUG * @param pObject the message Object
 void debug(java.lang.Object message, java.lang.Throwable obj)
           
 void error(java.lang.Object pObject)
          generate a message for loglevel ERROR * @param pObject the message Object
 void error(java.lang.Object message, java.lang.Throwable obj)
           
 void fatal(java.lang.Object pObject)
          generate a message for loglevel FATAL * @param pObject the message Object
 void fatal(java.lang.Object message, java.lang.Throwable obj)
           
 org.apache.commons.logging.Log getLog()
          Returns the log.
 java.lang.String getName()
          returns the name of the logger isntance
 void info(java.lang.Object pObject)
          generate a message for loglevel INFO * @param pObject the message Object
 void info(java.lang.Object message, java.lang.Throwable obj)
           
 boolean isDebugEnabled()
           
 boolean isEnabledFor(int priority)
           
 void safeDebug(java.lang.String message, java.lang.Object obj)
          Exception safe log method.
 void safeDebug(java.lang.String message, java.lang.Object obj, java.lang.Throwable t)
          Exception safe log method.
 void safeError(java.lang.String message, java.lang.Object obj)
          Exception safe log method.
 void safeError(java.lang.String message, java.lang.Object obj, java.lang.Throwable t)
          Exception safe log method.
 void safeFatal(java.lang.String message, java.lang.Object obj)
          Exception safe log method.
 void safeFatal(java.lang.String message, java.lang.Object obj, java.lang.Throwable t)
          Exception safe log method.
 void safeInfo(java.lang.String message, java.lang.Object obj)
          Exception safe log method.
 void safeInfo(java.lang.String message, java.lang.Object obj, java.lang.Throwable t)
          Exception safe log method.
 void safeWarn(java.lang.String message, java.lang.Object obj)
          Exception safe log method.
 void safeWarn(java.lang.String message, java.lang.Object obj, java.lang.Throwable t)
          Exception safe log method.
 void warn(java.lang.Object pObject)
          generate a message for loglevel WARN * @param pObject the message Object
 void warn(java.lang.Object message, java.lang.Throwable obj)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CommonsLoggerImpl

public CommonsLoggerImpl(java.lang.String aName)
Constructor for CommonsLoggerImpl.

Method Detail

debug

public void debug(java.lang.Object pObject)
Description copied from interface: Logger
generate a message for loglevel DEBUG * @param pObject the message Object

Specified by:
debug in interface Logger
See Also:
Logger.debug(Object)

info

public void info(java.lang.Object pObject)
Description copied from interface: Logger
generate a message for loglevel INFO * @param pObject the message Object

Specified by:
info in interface Logger
See Also:
Logger.info(Object)

warn

public void warn(java.lang.Object pObject)
Description copied from interface: Logger
generate a message for loglevel WARN * @param pObject the message Object

Specified by:
warn in interface Logger
See Also:
Logger.warn(Object)

error

public void error(java.lang.Object pObject)
Description copied from interface: Logger
generate a message for loglevel ERROR * @param pObject the message Object

Specified by:
error in interface Logger
See Also:
Logger.error(Object)

fatal

public void fatal(java.lang.Object pObject)
Description copied from interface: Logger
generate a message for loglevel FATAL * @param pObject the message Object

Specified by:
fatal in interface Logger
See Also:
Logger.fatal(Object)

debug

public void debug(java.lang.Object message,
                  java.lang.Throwable obj)
Specified by:
debug in interface Logger
See Also:
Logger.debug(Object, Throwable)

info

public void info(java.lang.Object message,
                 java.lang.Throwable obj)
Specified by:
info in interface Logger
See Also:
Logger.info(Object, Throwable)

warn

public void warn(java.lang.Object message,
                 java.lang.Throwable obj)
Specified by:
warn in interface Logger
See Also:
Logger.warn(Object, Throwable)

error

public void error(java.lang.Object message,
                  java.lang.Throwable obj)
Specified by:
error in interface Logger
See Also:
Logger.error(Object, Throwable)

fatal

public void fatal(java.lang.Object message,
                  java.lang.Throwable obj)
Specified by:
fatal in interface Logger
See Also:
Logger.fatal(Object, Throwable)

isEnabledFor

public boolean isEnabledFor(int priority)
Specified by:
isEnabledFor in interface Logger
See Also:
Logger.isEnabledFor(int)

isDebugEnabled

public boolean isDebugEnabled()
Specified by:
isDebugEnabled in interface Logger
See Also:
Logger.isDebugEnabled()

getName

public java.lang.String getName()
Description copied from interface: Logger
returns the name of the logger isntance

Specified by:
getName in interface Logger
See Also:
Logger.getName()

safeDebug

public void safeDebug(java.lang.String message,
                      java.lang.Object obj)
Description copied from interface: Logger
Exception safe log method. * This method can be used to prevent any exception thrown by obj.toString() implementations. * Log level used : DEBUG * @deprecated The normal logging methods should always be safe with regard to exceptions * that are thrown while accessing the arguments.

Specified by:
safeDebug in interface Logger
See Also:
Logger.safeDebug(String, Object)

safeDebug

public void safeDebug(java.lang.String message,
                      java.lang.Object obj,
                      java.lang.Throwable t)
Description copied from interface: Logger
Exception safe log method. * This method can be used to prevent any exception thrown by obj.toString() implementations. * Log level used : DEBUG * @deprecated The normal logging methods should always be safe with regard to exceptions * that are thrown while accessing the arguments.

Specified by:
safeDebug in interface Logger
See Also:
Logger.safeDebug(String, Object, Throwable)

safeInfo

public void safeInfo(java.lang.String message,
                     java.lang.Object obj)
Description copied from interface: Logger
Exception safe log method. * This method can be used to prevent any exception thrown by obj.toString() implementations. * Log level used : INFO * @deprecated The normal logging methods should always be safe with regard to exceptions * that are thrown while accessing the arguments.

Specified by:
safeInfo in interface Logger
See Also:
Logger.safeInfo(String, Object)

safeInfo

public void safeInfo(java.lang.String message,
                     java.lang.Object obj,
                     java.lang.Throwable t)
Description copied from interface: Logger
Exception safe log method. * This method can be used to prevent any exception thrown by obj.toString() implementations. * Log level used : INFO * @deprecated The normal logging methods should always be safe with regard to exceptions * that are thrown while accessing the arguments.

Specified by:
safeInfo in interface Logger
See Also:
Logger.safeInfo(String, Object, Throwable)

safeWarn

public void safeWarn(java.lang.String message,
                     java.lang.Object obj)
Description copied from interface: Logger
Exception safe log method. * This method can be used to prevent any exception thrown by obj.toString() implementations. * Log level used : WARN * @deprecated The normal logging methods should always be safe with regard to exceptions * that are thrown while accessing the arguments.

Specified by:
safeWarn in interface Logger
See Also:
Logger.safeWarn(String, Object)

safeWarn

public void safeWarn(java.lang.String message,
                     java.lang.Object obj,
                     java.lang.Throwable t)
Description copied from interface: Logger
Exception safe log method. * This method can be used to prevent any exception thrown by obj.toString() implementations. * Log level used : WARN * @deprecated The normal logging methods should always be safe with regard to exceptions * that are thrown while accessing the arguments.

Specified by:
safeWarn in interface Logger
See Also:
Logger.safeWarn(String, Object, Throwable)

safeError

public void safeError(java.lang.String message,
                      java.lang.Object obj)
Description copied from interface: Logger
Exception safe log method. * This method can be used to prevent any exception thrown by obj.toString() implementations. * Log level used : ERROR * @deprecated The normal logging methods should always be safe with regard to exceptions * that are thrown while accessing the arguments.

Specified by:
safeError in interface Logger
See Also:
Logger.safeError(String, Object)

safeError

public void safeError(java.lang.String message,
                      java.lang.Object obj,
                      java.lang.Throwable t)
Description copied from interface: Logger
Exception safe log method. * This method can be used to prevent any exception thrown by obj.toString() implementations. * Log level used : ERROR * @deprecated The normal logging methods should always be safe with regard to exceptions * that are thrown while accessing the arguments.

Specified by:
safeError in interface Logger
See Also:
Logger.safeError(String, Object, Throwable)

safeFatal

public void safeFatal(java.lang.String message,
                      java.lang.Object obj)
Description copied from interface: Logger
Exception safe log method. * This method can be used to prevent any exception thrown by obj.toString() implementations. * Log level used : FATAL * @deprecated The normal logging methods should always be safe with regard to exceptions * that are thrown while accessing the arguments.

Specified by:
safeFatal in interface Logger
See Also:
Logger.safeFatal(String, Object)

safeFatal

public void safeFatal(java.lang.String message,
                      java.lang.Object obj,
                      java.lang.Throwable t)
Description copied from interface: Logger
Exception safe log method. * This method can be used to prevent any exception thrown by obj.toString() implementations. * Log level used : FATAL * @deprecated The normal logging methods should always be safe with regard to exceptions * that are thrown while accessing the arguments.

Specified by:
safeFatal in interface Logger
See Also:
Logger.safeFatal(String, Object, Throwable)

configure

public void configure(org.apache.ojb.broker.util.configuration.Configuration config)
               throws org.apache.ojb.broker.util.configuration.ConfigurationException
Description copied from interface: Logger
Configure this logging. Note that the config object will be an instance * of LoggingConfiguration. * * @param config The LoggingConfiguration object * @throws ConfigurationException

Specified by:
configure in interface Logger
Throws:
org.apache.ojb.broker.util.configuration.ConfigurationException
See Also:
Configurable.configure(Configuration)

getLog

public org.apache.commons.logging.Log getLog()
Returns the log.

Returns:
Log


(C) 2002 - 2004 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.3, 2005-04-2