|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.logging.Logger
Logger wrapper that tries to dynamically load a log4j class to determine if log4j is available in the VM. If it is the case, a log4j delegate is built and used. In the contrary, a null logger is used. This class cannot directly reference log4j classes otherwise the JVM will try to load it and make it fail. To set
Only exposes the relevent factory and logging methods.
isTraceEnabled()
,
trace(Object)
,
trace(Object,Throwable)
,
Serialized FormField Summary | |
protected static java.lang.String |
LOG4J_PLUGIN_CLASS_NAME
The default LoggerPlugin implementation is log4j |
protected LoggerPlugin (src) |
loggerDelegate
|
protected static java.lang.String |
PLUGIN_CLASS_PROP
The system property to look for an externalized LoggerPlugin implementation class |
protected static java.lang.Class |
pluginClass
The LoggerPlugin implementation class to use |
protected static java.lang.String |
pluginClassName
The class name of the LoggerPlugin implementation class to use |
Constructor Summary | |
protected |
Logger(java.lang.String name)
Creates new Logger the given logger name. |
Method Summary | |
void |
debug(java.lang.Object message)
Issue a log msg with a level of DEBUG. |
void |
debug(java.lang.Object message,
java.lang.Throwable t)
Issue a log msg and throwable with a level of DEBUG. |
void |
error(java.lang.Object message)
Issue a log msg with a level of ERROR. |
void |
error(java.lang.Object message,
java.lang.Throwable t)
Issue a log msg and throwable with a level of ERROR. |
void |
fatal(java.lang.Object message)
Issue a log msg with a level of FATAL. |
void |
fatal(java.lang.Object message,
java.lang.Throwable t)
Issue a log msg and throwable with a level of FATAL. |
protected static LoggerPlugin (src) |
getDelegatePlugin(java.lang.String name)
|
static Logger (src) |
getLogger(java.lang.Class clazz)
Create a Logger instance given the logger class. |
static Logger (src) |
getLogger(java.lang.Class clazz,
java.lang.String suffix)
Create a Logger instance given the logger class with the given suffix. |
static Logger (src) |
getLogger(java.lang.String name)
Create a Logger instance given the logger name. |
static Logger (src) |
getLogger(java.lang.String name,
java.lang.String suffix)
Create a Logger instance given the logger name with the given suffix. |
LoggerPlugin (src) |
getLoggerPlugin()
|
java.lang.String |
getName()
Return the name of this logger. |
static java.lang.String |
getPluginClassName()
The LoggerPlugin implementation class name in use |
void |
info(java.lang.Object message)
Issue a log msg with a level of INFO. |
void |
info(java.lang.Object message,
java.lang.Throwable t)
Issue a log msg and throwable with a level of INFO. |
protected static void |
init()
Initialize the LoggerPlugin class to use as the delegate to the logging system. |
boolean |
isDebugEnabled()
Check to see if the TRACE level is enabled for this logger. |
boolean |
isInfoEnabled()
Check to see if the INFO level is enabled for this logger. |
boolean |
isTraceEnabled()
Check to see if the TRACE level is enabled for this logger. |
static void |
setPluginClassName(java.lang.String pluginClassName)
Set the LoggerPlugin implementation class name in use |
void |
trace(java.lang.Object message)
Issue a log msg with a level of TRACE. |
void |
trace(java.lang.Object message,
java.lang.Throwable t)
Issue a log msg and throwable with a level of TRACE. |
void |
warn(java.lang.Object message)
Issue a log msg with a level of WARN. |
void |
warn(java.lang.Object message,
java.lang.Throwable t)
Issue a log msg and throwable with a level of WARN. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected static java.lang.String PLUGIN_CLASS_PROP
protected static final java.lang.String LOG4J_PLUGIN_CLASS_NAME
protected static java.lang.Class pluginClass
protected static java.lang.String pluginClassName
protected transient LoggerPlugin (src) loggerDelegate
Constructor Detail |
protected Logger(java.lang.String name)
name
- the logger name.Method Detail |
public static java.lang.String getPluginClassName()
public static void setPluginClassName(java.lang.String pluginClassName)
pluginClassName
- the LoggerPlugin implementation class namepublic java.lang.String getName()
public LoggerPlugin (src) getLoggerPlugin()
public boolean isTraceEnabled()
trace(Object)
method invocation would pass
the msg to the configured appenders, false otherwise.public void trace(java.lang.Object message)
public void trace(java.lang.Object message, java.lang.Throwable t)
public boolean isDebugEnabled()
trace(Object)
method invocation would pass
the msg to the configured appenders, false otherwise.public void debug(java.lang.Object message)
public void debug(java.lang.Object message, java.lang.Throwable t)
public boolean isInfoEnabled()
info(Object)
method invocation would pass
the msg to the configured appenders, false otherwise.public void info(java.lang.Object message)
public void info(java.lang.Object message, java.lang.Throwable t)
public void warn(java.lang.Object message)
public void warn(java.lang.Object message, java.lang.Throwable t)
public void error(java.lang.Object message)
public void error(java.lang.Object message, java.lang.Throwable t)
public void fatal(java.lang.Object message)
public void fatal(java.lang.Object message, java.lang.Throwable t)
public static Logger (src) getLogger(java.lang.String name)
name
- the logger namepublic static Logger (src) getLogger(java.lang.String name, java.lang.String suffix)
This will include a logger seperator between classname and suffix
name
- The logger namesuffix
- A suffix to append to the classname.public static Logger (src) getLogger(java.lang.Class clazz)
clazz
- the Class whose name will be used as the logger namepublic static Logger (src) getLogger(java.lang.Class clazz, java.lang.String suffix)
This will include a logger seperator between classname and suffix
clazz
- The Class whose name will be used as the logger name.suffix
- A suffix to append to the classname.protected static LoggerPlugin (src) getDelegatePlugin(java.lang.String name)
protected static void init()
setPluginClassName(String)
method,
then the PLUGIN_CLASS_PROP system property and finally the
LOG4J_PLUGIN_CLASS_NAME default. If the LoggerPlugin implementation
class cannot be loaded the default NullLoggerPlugin will be used.
|
||||||||||
PREV CLASS (src) NEXT CLASS (src) | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |