Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

ojb.broker.util.logging
Class Log4jLoggerImpl  view Log4jLoggerImpl download Log4jLoggerImpl.java

java.lang.Object
  extended byojb.broker.util.logging.Log4jLoggerImpl
All Implemented Interfaces:
ojb.broker.util.configuration.Configurable, Logger, java.io.Serializable

public class Log4jLoggerImpl
extends java.lang.Object
implements Logger

This is a Logger implementation based on Log4j. It can be enabled by putting LoggerClass=ojb.broker.util.logging.Log4jLoggerImpl in the OJB .properties file.
If you want log4j to initialize from a property file you can add LoggerConfigFile=log4j.properties to the ojb.properties file. the logger only initializes log4j if the application hasn't done it yet You can find sample log4j.properties file in the log4j web site http://jakarta.apache.org/log4j in the javadoc look for org.apache.log4j.examples

Version:
$Id: Log4jLoggerImpl.java,v 1.4 2002/05/06 23:19:02 cgreenlee Exp $

Field Summary
private  org.apache.log4j.Category cat
           
private  java.lang.String configFile
           
private static boolean log4jconfigured
           
private  java.lang.String name
           
private static java.util.HashMap priorityMap
           
 
Fields inherited from interface ojb.broker.util.logging.Logger
DEBUG, ERROR, FATAL, INFO, WARN
 
Constructor Summary
Log4jLoggerImpl(java.lang.String name)
           
 
Method Summary
 void configure(ojb.broker.util.configuration.Configuration config)
          configure an object using the Configuration config
 void debug(java.lang.Object pObject)
          generate a message for loglevel DEBUG
 void debug(java.lang.Object message, java.lang.Throwable obj)
           
 void error(java.lang.Object pObject)
          generate a message for loglevel ERROR
 void error(java.lang.Object message, java.lang.Throwable obj)
           
 void fatal(java.lang.Object pObject)
          generate a message for loglevel FATAL
 void fatal(java.lang.Object message, java.lang.Throwable obj)
           
private  org.apache.log4j.Category getCat()
          Gets the cat.
 void info(java.lang.Object pObject)
          generate a message for loglevel INFO
 void info(java.lang.Object message, java.lang.Throwable obj)
           
 boolean isDebugEnabled()
           
 boolean isEnabledFor(int priority)
           
private  void setConfigurationFile(java.lang.String configurationFile)
           
 void warn(java.lang.Object pObject)
          generate a message for loglevel WARN
 void warn(java.lang.Object message, java.lang.Throwable obj)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

priorityMap

private static java.util.HashMap priorityMap

log4jconfigured

private static boolean log4jconfigured

cat

private transient org.apache.log4j.Category cat

name

private java.lang.String name

configFile

private java.lang.String configFile
Constructor Detail

Log4jLoggerImpl

public Log4jLoggerImpl(java.lang.String name)
Method Detail

getCat

private org.apache.log4j.Category getCat()
Gets the cat.


debug

public final void debug(java.lang.Object pObject)
generate a message for loglevel DEBUG

Specified by:
debug in interface Logger

info

public final void info(java.lang.Object pObject)
generate a message for loglevel INFO

Specified by:
info in interface Logger

warn

public final void warn(java.lang.Object pObject)
generate a message for loglevel WARN

Specified by:
warn in interface Logger

error

public final void error(java.lang.Object pObject)
generate a message for loglevel ERROR

Specified by:
error in interface Logger

fatal

public final void fatal(java.lang.Object pObject)
generate a message for loglevel FATAL

Specified by:
fatal in interface Logger

debug

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

error

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

fatal

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

info

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

warn

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

isDebugEnabled

public boolean isDebugEnabled()
Specified by:
isDebugEnabled in interface Logger

isEnabledFor

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

configure

public void configure(ojb.broker.util.configuration.Configuration config)
               throws ojb.broker.util.configuration.ConfigurationException
Description copied from interface: ojb.broker.util.configuration.Configurable
configure an object using the Configuration config

Specified by:
configure in interface ojb.broker.util.configuration.Configurable

setConfigurationFile

private void setConfigurationFile(java.lang.String configurationFile)