|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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 String |
LOG4J_PLUGIN_CLASS_NAME
The default LoggerPlugin implementation is log4j |
protected LoggerPlugin |
loggerDelegate
|
protected static String |
PLUGIN_CLASS_PROP
The system property to look for an externalized LoggerPlugin implementation class |
protected static Class |
pluginClass
The LoggerPlugin implementation class to use |
protected static String |
pluginClassName
The class name of the LoggerPlugin implementation class to use |
Constructor Summary | |
protected |
Logger(String name)
Creates new Logger the given logger name. |
Method Summary | |
void |
debug(Object message)
Issue a log msg with a level of DEBUG. |
void |
debug(Object message,
Throwable t)
Issue a log msg and throwable with a level of DEBUG. |
void |
error(Object message)
Issue a log msg with a level of ERROR. |
void |
error(Object message,
Throwable t)
Issue a log msg and throwable with a level of ERROR. |
void |
fatal(Object message)
Issue a log msg with a level of FATAL. |
void |
fatal(Object message,
Throwable t)
Issue a log msg and throwable with a level of FATAL. |
protected static LoggerPlugin |
getDelegatePlugin(String name)
|
static Logger |
getLogger(Class clazz)
Create a Logger instance given the logger class. |
static Logger |
getLogger(Class clazz,
String suffix)
Create a Logger instance given the logger class with the given suffix. |
static Logger |
getLogger(String name)
Create a Logger instance given the logger name. |
static Logger |
getLogger(String name,
String suffix)
Create a Logger instance given the logger name with the given suffix. |
LoggerPlugin |
getLoggerPlugin()
|
String |
getName()
Return the name of this logger. |
static String |
getPluginClassName()
The LoggerPlugin implementation class name in use |
void |
info(Object message)
Issue a log msg with a level of INFO. |
void |
info(Object message,
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(String pluginClassName)
Set the LoggerPlugin implementation class name in use |
void |
trace(Object message)
Issue a log msg with a level of TRACE. |
void |
trace(Object message,
Throwable t)
Issue a log msg and throwable with a level of TRACE. |
void |
warn(Object message)
Issue a log msg with a level of WARN. |
void |
warn(Object message,
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 String PLUGIN_CLASS_PROP
protected static final String LOG4J_PLUGIN_CLASS_NAME
protected static Class pluginClass
protected static String pluginClassName
protected transient LoggerPlugin loggerDelegate
Constructor Detail |
protected Logger(String name)
name
- the logger name.Method Detail |
public static String getPluginClassName()
public static void setPluginClassName(String pluginClassName)
pluginClassName
- the LoggerPlugin implementation class namepublic String getName()
public LoggerPlugin getLoggerPlugin()
public boolean isTraceEnabled()
trace(Object)
method invocation would pass
the msg to the configured appenders, false otherwise.public void trace(Object message)
public void trace(Object message, Throwable t)
public boolean isDebugEnabled()
trace(Object)
method invocation would pass
the msg to the configured appenders, false otherwise.public void debug(Object message)
public void debug(Object message, Throwable t)
public boolean isInfoEnabled()
info(Object)
method invocation would pass
the msg to the configured appenders, false otherwise.public void info(Object message)
public void info(Object message, Throwable t)
public void warn(Object message)
public void warn(Object message, Throwable t)
public void error(Object message)
public void error(Object message, Throwable t)
public void fatal(Object message)
public void fatal(Object message, Throwable t)
public static Logger getLogger(String name)
name
- the logger namepublic static Logger getLogger(String name, 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 getLogger(Class clazz)
clazz
- the Class whose name will be used as the logger namepublic static Logger getLogger(Class clazz, 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 getDelegatePlugin(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 NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |