|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.ojb.broker.util.logging.Log4jLoggerImpl
public class Log4jLoggerImpl
This is a Logger implementation based on Log4j.
It can be enabled by putting
LoggerClass=org.apache.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 org.apache.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
Field Summary | |
---|---|
private static String |
FQCN
|
private static boolean |
log4jConfigured
flag about log4j configuration state |
private org.apache.log4j.Logger |
logger
|
private String |
name
|
Fields inherited from interface org.apache.ojb.broker.util.logging.Logger |
---|
DEBUG, ERROR, FATAL, INFO, serialVersionUID, WARN |
Constructor Summary | |
---|---|
Log4jLoggerImpl(String name)
|
Method Summary | |
---|---|
void |
configure(Configuration config)
Configure this logging. |
void |
debug(Object pObject)
generate a message for loglevel DEBUG |
void |
debug(Object message,
Throwable obj)
|
void |
error(Object pObject)
generate a message for loglevel ERROR |
void |
error(Object message,
Throwable obj)
|
void |
fatal(Object pObject)
generate a message for loglevel FATAL |
void |
fatal(Object message,
Throwable obj)
|
private org.apache.log4j.Level |
getLevel()
|
private org.apache.log4j.Logger |
getLogger()
Gets the logger. |
String |
getName()
returns the name of the logger isntance |
void |
info(Object pObject)
generate a message for loglevel INFO |
void |
info(Object message,
Throwable obj)
|
private static void |
initializeLog4JSubSystem(String configFile)
Initialization of log4j NOTE - if log4j property file is called log4j.properties then log4j will be configured already. |
boolean |
isDebugEnabled()
|
boolean |
isEnabledFor(int priority)
|
private static boolean |
isLog4JConfigured()
Helper method to check if log4j is already configured |
void |
safeDebug(String message,
Object obj)
Exception safe log method. |
void |
safeDebug(String message,
Object obj,
Throwable throwable)
Exception safe log method. |
void |
safeError(String message,
Object obj)
Exception safe log method. |
void |
safeError(String message,
Object obj,
Throwable throwable)
Exception safe log method. |
void |
safeFatal(String message,
Object obj)
Exception safe log method. |
void |
safeFatal(String message,
Object obj,
Throwable throwable)
Exception safe log method. |
void |
safeInfo(String message,
Object obj)
Exception safe log method. |
void |
safeInfo(String message,
Object obj,
Throwable throwable)
Exception safe log method. |
void |
safeWarn(String message,
Object obj)
Exception safe log method. |
void |
safeWarn(String message,
Object obj,
Throwable throwable)
Exception safe log method. |
void |
warn(Object pObject)
generate a message for loglevel WARN |
void |
warn(Object message,
Throwable obj)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final String FQCN
private static boolean log4jConfigured
private transient org.apache.log4j.Logger logger
private String name
Constructor Detail |
---|
public Log4jLoggerImpl(String name)
Method Detail |
---|
private static boolean isLog4JConfigured()
private static void initializeLog4JSubSystem(String configFile)
public void configure(Configuration config) throws ConfigurationException
Logger
LoggingConfiguration
.
configure
in interface Configurable
configure
in interface Logger
config
- The LoggingConfiguration
object
ConfigurationException
This method must be performed by LogFactory after creating a logger instance.
private org.apache.log4j.Logger getLogger()
public String getName()
Logger
getName
in interface Logger
private org.apache.log4j.Level getLevel()
public final void debug(Object pObject)
debug
in interface Logger
pObject
- the message Objectpublic final void info(Object pObject)
info
in interface Logger
pObject
- the message Objectpublic final void warn(Object pObject)
warn
in interface Logger
pObject
- the message Objectpublic final void error(Object pObject)
error
in interface Logger
pObject
- the message Objectpublic final void fatal(Object pObject)
fatal
in interface Logger
pObject
- the message Objectpublic void debug(Object message, Throwable obj)
debug
in interface Logger
public void error(Object message, Throwable obj)
error
in interface Logger
public void fatal(Object message, Throwable obj)
fatal
in interface Logger
public void info(Object message, Throwable obj)
info
in interface Logger
public void warn(Object message, Throwable obj)
warn
in interface Logger
public void safeDebug(String message, Object obj)
Logger
safeDebug
in interface Logger
public void safeDebug(String message, Object obj, Throwable throwable)
Logger
safeDebug
in interface Logger
public void safeInfo(String message, Object obj)
Logger
safeInfo
in interface Logger
public void safeInfo(String message, Object obj, Throwable throwable)
Logger
safeInfo
in interface Logger
public void safeWarn(String message, Object obj)
Logger
safeWarn
in interface Logger
public void safeWarn(String message, Object obj, Throwable throwable)
Logger
safeWarn
in interface Logger
public void safeError(String message, Object obj)
Logger
safeError
in interface Logger
public void safeError(String message, Object obj, Throwable throwable)
Logger
safeError
in interface Logger
public void safeFatal(String message, Object obj)
Logger
safeFatal
in interface Logger
public void safeFatal(String message, Object obj, Throwable throwable)
Logger
safeFatal
in interface Logger
public boolean isDebugEnabled()
isDebugEnabled
in interface Logger
public boolean isEnabledFor(int priority)
isEnabledFor
in interface Logger
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |