Save This Page
Home » jboss-5.0.0.CR1-src » org » jboss » logging » [javadoc | source]
org.jboss.logging
public class: Logger [javadoc | source]
java.lang.Object
   org.jboss.logging.Logger

All Implemented Interfaces:
    Serializable

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.

Field Summary
protected static  String PLUGIN_CLASS_PROP    The system property to look for an externalized LoggerPlugin implementation class 
protected static final  String LOG4J_PLUGIN_CLASS_NAME    The default LoggerPlugin implementation is log4j 
protected static  Class pluginClass    The LoggerPlugin implementation class to use 
protected static  String pluginClassName    The class name of the LoggerPlugin implementation class to use 
protected transient  LoggerPlugin loggerDelegate     
Constructor:
 protected Logger(String name) 
    Creates new Logger the given logger name.
    Parameters:
    name - the logger name.
Method from org.jboss.logging.Logger Summary:
debug,   debug,   error,   error,   fatal,   fatal,   getDelegatePlugin,   getLogger,   getLogger,   getLogger,   getLogger,   getLoggerPlugin,   getName,   getPluginClassName,   info,   info,   init,   isDebugEnabled,   isInfoEnabled,   isTraceEnabled,   setPluginClassName,   trace,   trace,   warn,   warn
Methods from java.lang.Object:
equals,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.jboss.logging.Logger Detail:
 public  void debug(Object message) 
    Issue a log msg with a level of DEBUG. Invokes log.log(Level.DEBUG, message);
 public  void debug(Object message,
    Throwable t) 
    Issue a log msg and throwable with a level of DEBUG. Invokes log.log(Level.DEBUG, message, t);
 public  void error(Object message) 
    Issue a log msg with a level of ERROR. Invokes log.log(Level.ERROR, message);
 public  void error(Object message,
    Throwable t) 
    Issue a log msg and throwable with a level of ERROR. Invokes log.log(Level.ERROR, message, t);
 public  void fatal(Object message) 
    Issue a log msg with a level of FATAL. Invokes log.log(Level.FATAL, message);
 public  void fatal(Object message,
    Throwable t) 
    Issue a log msg and throwable with a level of FATAL. Invokes log.log(Level.FATAL, message, t);
 protected static LoggerPlugin getDelegatePlugin(String name) 
 public static Logger getLogger(String name) 
    Create a Logger instance given the logger name.
 public static Logger getLogger(Class clazz) 
    Create a Logger instance given the logger class. This simply calls create(clazz.getName()).
 public static Logger getLogger(String name,
    String suffix) 
    Create a Logger instance given the logger name with the given suffix.

    This will include a logger seperator between classname and suffix

 public static Logger getLogger(Class clazz,
    String suffix) 
    Create a Logger instance given the logger class with the given suffix.

    This will include a logger seperator between classname and suffix

 public LoggerPlugin getLoggerPlugin() 
 public String getName() 
    Return the name of this logger.
 public static String getPluginClassName() 
    The LoggerPlugin implementation class name in use
 public  void info(Object message) 
    Issue a log msg with a level of INFO. Invokes log.log(Level.INFO, message);
 public  void info(Object message,
    Throwable t) 
    Issue a log msg and throwable with a level of INFO. Invokes log.log(Level.INFO, message, t);
 protected static  void init() 
    Initialize the LoggerPlugin class to use as the delegate to the logging system. This first checks to see if a pluginClassName has been specified via the #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.
 public boolean isDebugEnabled() 
    Check to see if the TRACE level is enabled for this logger.
 public boolean isInfoEnabled() 
    Check to see if the INFO level is enabled for this logger.
 public boolean isTraceEnabled() 
    Check to see if the TRACE level is enabled for this logger.
 public static  void setPluginClassName(String pluginClassName) 
    Set the LoggerPlugin implementation class name in use
 public  void trace(Object message) 
    Issue a log msg with a level of TRACE. Invokes log.log(XLevel.TRACE, message);
 public  void trace(Object message,
    Throwable t) 
    Issue a log msg and throwable with a level of TRACE. Invokes log.log(XLevel.TRACE, message, t);
 public  void warn(Object message) 
    Issue a log msg with a level of WARN. Invokes log.log(Level.WARN, message);
 public  void warn(Object message,
    Throwable t) 
    Issue a log msg and throwable with a level of WARN. Invokes log.log(Level.WARN, message, t);