JBoss Logging Programming Interface 2.2.0.CR2-SNAPSHOT

org.jboss.logging
Class Logger

java.lang.Object
  extended by org.jboss.logging.Logger
All Implemented Interfaces:
Serializable

public class Logger
extends Object
implements 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 relevant factory and logging methods.

For JBoss the logging should be done as follows:

Version:
$Revision: 3992 $
Author:
Scott.Stark@jboss.org, Jason Dillon, Sacha Labourey
See Also:
isTraceEnabled(), trace(Object), trace(Object,Throwable), Serialized Form

Nested Class Summary
static class Logger.Level
          Levels used by this logging API.
 
Field Summary
protected static String LOG4J_PLUGIN_CLASS_NAME
          The default LoggerPlugin implementation is log4j
protected  LoggerPluginInstance loggerDelegate
          The logger plugin delegate
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
 
Method Summary
 void debug(Object message)
          Issue a log message with a level of DEBUG.
 void debug(Object message, Object[] params)
          Issue a log message with parameters with a level of DEBUG.
 void debug(Object message, Object[] params, Throwable t)
          Issue a log message with parameters and a throwable with a level of DEBUG.
 void debug(Object message, Throwable t)
          Issue a log message and throwable with a level of DEBUG.
 void debug(String loggerFqcn, Object message, Object[] params, Throwable t)
          Issue a log message with parameters and a throwable with a level of DEBUG.
 void debug(String loggerFqcn, Object message, Throwable t)
          Issue a log message and throwable with a level of DEBUG and a specific logger class name.
 void debugf(String format, Object... params)
          Issue a formatted log message with a level of DEBUG.
 void debugf(String format, Object param1)
          Issue a formatted log message with a level of DEBUG.
 void debugf(String format, Object param1, Object param2)
          Issue a formatted log message with a level of DEBUG.
 void debugf(String format, Object param1, Object param2, Object param3)
          Issue a formatted log message with a level of DEBUG.
 void debugf(Throwable t, String format, Object... params)
          Issue a formatted log message with a level of DEBUG.
 void debugf(Throwable t, String format, Object param1)
          Issue a formatted log message with a level of DEBUG.
 void debugf(Throwable t, String format, Object param1, Object param2)
          Issue a formatted log message with a level of DEBUG.
 void debugf(Throwable t, String format, Object param1, Object param2, Object param3)
          Issue a formatted log message with a level of DEBUG.
 void error(Object message)
          Issue a log message with a level of ERROR.
 void error(Object message, Object[] params)
          Issue a log message with parameters with a level of ERROR.
 void error(Object message, Object[] params, Throwable t)
          Issue a log message with parameters and a throwable with a level of ERROR.
 void error(Object message, Throwable t)
          Issue a log message and throwable with a level of ERROR.
 void error(String loggerFqcn, Object message, Object[] params, Throwable t)
          Issue a log message with parameters and a throwable with a level of ERROR.
 void error(String loggerFqcn, Object message, Throwable t)
          Issue a log message and throwable with a level of ERROR and a specific logger class name.
 void errorf(String format, Object... params)
          Issue a formatted log message with a level of ERROR.
 void errorf(String format, Object param1)
          Issue a formatted log message with a level of ERROR.
 void errorf(String format, Object param1, Object param2)
          Issue a formatted log message with a level of ERROR.
 void errorf(String format, Object param1, Object param2, Object param3)
          Issue a formatted log message with a level of ERROR.
 void errorf(Throwable t, String format, Object... params)
          Issue a formatted log message with a level of ERROR.
 void errorf(Throwable t, String format, Object param1)
          Issue a formatted log message with a level of ERROR.
 void errorf(Throwable t, String format, Object param1, Object param2)
          Issue a formatted log message with a level of ERROR.
 void errorf(Throwable t, String format, Object param1, Object param2, Object param3)
          Issue a formatted log message with a level of ERROR.
 void fatal(Object message)
          Issue a log message with a level of FATAL.
 void fatal(Object message, Object[] params)
          Issue a log message with parameters with a level of FATAL.
 void fatal(Object message, Object[] params, Throwable t)
          Issue a log message with parameters and a throwable with a level of FATAL.
 void fatal(Object message, Throwable t)
          Issue a log message and throwable with a level of FATAL.
 void fatal(String loggerFqcn, Object message, Object[] params, Throwable t)
          Issue a log message with parameters and a throwable with a level of FATAL.
 void fatal(String loggerFqcn, Object message, Throwable t)
          Issue a log message and throwable with a level of FATAL and a specific logger class name.
 void fatalf(String format, Object... params)
          Issue a formatted log message with a level of FATAL.
 void fatalf(String format, Object param1)
          Issue a formatted log message with a level of FATAL.
 void fatalf(String format, Object param1, Object param2)
          Issue a formatted log message with a level of FATAL.
 void fatalf(String format, Object param1, Object param2, Object param3)
          Issue a formatted log message with a level of FATAL.
 void fatalf(Throwable t, String format, Object... params)
          Issue a formatted log message with a level of FATAL.
 void fatalf(Throwable t, String format, Object param1)
          Issue a formatted log message with a level of FATAL.
 void fatalf(Throwable t, String format, Object param1, Object param2)
          Issue a formatted log message with a level of FATAL.
 void fatalf(Throwable t, String format, Object param1, Object param2, Object param3)
          Issue a formatted log message with a level of FATAL.
static Logger getI18nLogger(Class<?> clazz, String resourceBundleName)
          Get a logger instance with the given name using the given resource bundle (if supported by the underlying framework).
static Logger getI18nLogger(String name, String resourceBundleName)
          Get a logger instance with the given name using the given resource bundle (if supported by the underlying framework).
static Logger getLogger(Class<?> clazz)
          Get a Logger instance given the name of a class.
static Logger getLogger(Class<?> clazz, String suffix)
          Get a Logger instance given the name of a class with the given suffix.
static Logger getLogger(String name)
          Get a Logger instance given the logger name.
static Logger getLogger(String name, String suffix)
          Get a Logger instance given the logger name with the given suffix.
 LoggerPlugin getLoggerPlugin()
          Get the logger plugin.
 LoggerPluginInstance getLoggerPluginInstance()
          Get the logger plugin delegate
 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 message with a level of INFO.
 void info(Object message, Object[] params)
          Issue a log message with parameters with a level of INFO.
 void info(Object message, Object[] params, Throwable t)
          Issue a log message with parameters and a throwable with a level of INFO.
 void info(Object message, Throwable t)
          Issue a log message and throwable with a level of INFO.
 void info(String loggerFqcn, Object message, Object[] params, Throwable t)
          Issue a log message with parameters and a throwable with a level of INFO.
 void info(String loggerFqcn, Object message, Throwable t)
          Issue a log message and throwable with a level of INFO and a specific logger class name.
 void infof(String format, Object... params)
          Issue a formatted log message with a level of INFO.
 void infof(String format, Object param1)
          Issue a formatted log message with a level of INFO.
 void infof(String format, Object param1, Object param2)
          Issue a formatted log message with a level of INFO.
 void infof(String format, Object param1, Object param2, Object param3)
          Issue a formatted log message with a level of INFO.
 void infof(Throwable t, String format, Object... params)
          Issue a formatted log message with a level of INFO.
 void infof(Throwable t, String format, Object param1)
          Issue a formatted log message with a level of INFO.
 void infof(Throwable t, String format, Object param1, Object param2)
          Issue a formatted log message with a level of INFO.
 void infof(Throwable t, String format, Object param1, Object param2, Object param3)
          Issue a formatted log message 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 DEBUG 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.
 void log(Logger.Level level, Object message)
          Log a message at the given level.
 void log(Logger.Level level, Object message, Object[] params)
          Log a message at the given level.
 void log(Logger.Level level, Object message, Object[] params, Throwable t)
          Log a message at the given level.
 void log(String loggerFqcn, Logger.Level level, Object message, Object[] params, Throwable t)
          Log a message at the given level.
 void logf(Logger.Level level, String format, Object... params)
          Log a message at the given level.
 void logf(Logger.Level level, String format, Object param1)
          Log a message at the given level.
 void logf(Logger.Level level, String format, Object param1, Object param2)
          Log a message at the given level.
 void logf(Logger.Level level, String format, Object param1, Object param2, Object param3)
          Log a message at the given level.
 void logf(Logger.Level level, Throwable t, String format, Object... params)
          Log a message at the given level.
 void logf(Logger.Level level, Throwable t, String format, Object param1)
          Log a message at the given level.
 void logf(Logger.Level level, Throwable t, String format, Object param1, Object param2)
          Log a message at the given level.
 void logf(Logger.Level level, Throwable t, String format, Object param1, Object param2, Object param3)
          Log a message at the given level.
 void logf(String loggerFqcn, Logger.Level level, Throwable t, String format, Object... params)
          Log a message at the given level.
 void logf(String loggerFqcn, Logger.Level level, Throwable t, String format, Object param1)
          Log a message at the given level.
 void logf(String loggerFqcn, Logger.Level level, Throwable t, String format, Object param1, Object param2)
          Log a message at the given level.
 void logf(String loggerFqcn, Logger.Level level, Throwable t, String format, Object param1, Object param2, Object param3)
          Log a message at the given level.
protected  Object readResolve()
          Read resolver; replaces deserialized instance with a canonical instance.
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, Object[] params)
          Issue a log message with parameters with a level of TRACE.
 void trace(Object message, Object[] params, Throwable t)
          Issue a log message with parameters and a throwable with a level of TRACE.
 void trace(Object message, Throwable t)
          Issue a log msg and throwable with a level of TRACE.
 void trace(String loggerFqcn, Object message, Object[] params, Throwable t)
          Issue a log message with parameters and a throwable with a level of TRACE.
 void trace(String loggerFqcn, Object message, Throwable t)
          Issue a log msg and throwable with a level of TRACE and a specific logger class name.
 void tracef(String format, Object... params)
          Issue a formatted log message with a level of TRACE.
 void tracef(String format, Object param1)
          Issue a formatted log message with a level of TRACE.
 void tracef(String format, Object param1, Object param2)
          Issue a formatted log message with a level of TRACE.
 void tracef(String format, Object param1, Object param2, Object param3)
          Issue a formatted log message with a level of TRACE.
 void tracef(Throwable t, String format, Object... params)
          Issue a formatted log message with a level of TRACE.
 void tracef(Throwable t, String format, Object param1)
          Issue a formatted log message with a level of TRACE.
 void tracef(Throwable t, String format, Object param1, Object param2)
          Issue a formatted log message with a level of TRACE.
 void tracef(Throwable t, String format, Object param1, Object param2, Object param3)
          Issue a formatted log message with a level of TRACE.
 void warn(Object message)
          Issue a log message with a level of WARN.
 void warn(Object message, Object[] params)
          Issue a log message with parameters with a level of WARN.
 void warn(Object message, Object[] params, Throwable t)
          Issue a log message with parameters and a throwable with a level of WARN.
 void warn(Object message, Throwable t)
          Issue a log message and throwable with a level of WARN.
 void warn(String loggerFqcn, Object message, Object[] params, Throwable t)
          Issue a log message with parameters and a throwable with a level of WARN.
 void warn(String loggerFqcn, Object message, Throwable t)
          Issue a log message and throwable with a level of WARN and a specific logger class name.
 void warnf(String format, Object... params)
          Issue a formatted log message with a level of WARN.
 void warnf(String format, Object param1)
          Issue a formatted log message with a level of WARN.
 void warnf(String format, Object param1, Object param2)
          Issue a formatted log message with a level of WARN.
 void warnf(String format, Object param1, Object param2, Object param3)
          Issue a formatted log message with a level of WARN.
 void warnf(Throwable t, String format, Object... params)
          Issue a formatted log message with a level of WARN.
 void warnf(Throwable t, String format, Object param1)
          Issue a formatted log message with a level of WARN.
 void warnf(Throwable t, String format, Object param1, Object param2)
          Issue a formatted log message with a level of WARN.
 void warnf(Throwable t, String format, Object param1, Object param2, Object param3)
          Issue a formatted log message 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

PLUGIN_CLASS_PROP

protected static String PLUGIN_CLASS_PROP
The system property to look for an externalized LoggerPlugin implementation class


LOG4J_PLUGIN_CLASS_NAME

protected static final String LOG4J_PLUGIN_CLASS_NAME
The default LoggerPlugin implementation is log4j

See Also:
Constant Field Values

pluginClass

protected static Class<?> pluginClass
The LoggerPlugin implementation class to use


pluginClassName

protected static String pluginClassName
The class name of the LoggerPlugin implementation class to use


loggerDelegate

protected transient LoggerPluginInstance loggerDelegate
The logger plugin delegate

Method Detail

getPluginClassName

public static String getPluginClassName()
The LoggerPlugin implementation class name in use

Returns:
LoggerPlugin implementation class name

setPluginClassName

public static void setPluginClassName(String pluginClassName)
Set the LoggerPlugin implementation class name in use

Parameters:
pluginClassName - the LoggerPlugin implementation class name

getName

public String getName()
Return the name of this logger.

Returns:
The name of this logger.

getLoggerPluginInstance

public LoggerPluginInstance getLoggerPluginInstance()
Get the logger plugin delegate

Returns:
the delegate

isTraceEnabled

public boolean isTraceEnabled()
Check to see if the TRACE level is enabled for this logger.

Returns:
true if a trace(Object) method invocation would pass the msg to the configured appenders, false otherwise.

trace

public void trace(Object message)
Issue a log msg with a level of TRACE.

Parameters:
message - the message

trace

public void trace(Object message,
                  Throwable t)
Issue a log msg and throwable with a level of TRACE.

Parameters:
message - the message
t - the throwable

trace

public void trace(String loggerFqcn,
                  Object message,
                  Throwable t)
Issue a log msg and throwable with a level of TRACE and a specific logger class name.

Parameters:
loggerFqcn - the logger class name
message - the message
t - the throwable

trace

public void trace(Object message,
                  Object[] params)
Issue a log message with parameters with a level of TRACE.

Parameters:
message - the message
params - the message parameters

trace

public void trace(Object message,
                  Object[] params,
                  Throwable t)
Issue a log message with parameters and a throwable with a level of TRACE.

Parameters:
message - the message
params - the message parameters
t - the throwable

trace

public void trace(String loggerFqcn,
                  Object message,
                  Object[] params,
                  Throwable t)
Issue a log message with parameters and a throwable with a level of TRACE.

Parameters:
loggerFqcn - the logger class name
message - the message
params - the message parameters
t - the throwable

tracef

public void tracef(String format,
                   Object... params)
Issue a formatted log message with a level of TRACE.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
params - the parameters

tracef

public void tracef(String format,
                   Object param1)
Issue a formatted log message with a level of TRACE.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the sole parameter

tracef

public void tracef(String format,
                   Object param1,
                   Object param2)
Issue a formatted log message with a level of TRACE.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the first parameter
param2 - the second parameter

tracef

public void tracef(String format,
                   Object param1,
                   Object param2,
                   Object param3)
Issue a formatted log message with a level of TRACE.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the first parameter
param2 - the second parameter
param3 - the third parameter

tracef

public void tracef(Throwable t,
                   String format,
                   Object... params)
Issue a formatted log message with a level of TRACE.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
params - the parameters

tracef

public void tracef(Throwable t,
                   String format,
                   Object param1)
Issue a formatted log message with a level of TRACE.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
param1 - the sole parameter

tracef

public void tracef(Throwable t,
                   String format,
                   Object param1,
                   Object param2)
Issue a formatted log message with a level of TRACE.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
param1 - the first parameter
param2 - the second parameter

tracef

public void tracef(Throwable t,
                   String format,
                   Object param1,
                   Object param2,
                   Object param3)
Issue a formatted log message with a level of TRACE.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
param1 - the first parameter
param2 - the second parameter
param3 - the third parameter

isDebugEnabled

public boolean isDebugEnabled()
Check to see if the DEBUG level is enabled for this logger.

Returns:
true if a debug(Object) method invocation would pass the msg to the configured appenders, false otherwise.

debug

public void debug(Object message)
Issue a log message with a level of DEBUG.

Parameters:
message - the message

debug

public void debug(Object message,
                  Throwable t)
Issue a log message and throwable with a level of DEBUG.

Parameters:
message - the message
t - the throwable

debug

public void debug(String loggerFqcn,
                  Object message,
                  Throwable t)
Issue a log message and throwable with a level of DEBUG and a specific logger class name.

Parameters:
loggerFqcn - the logger class name
message - the message
t - the throwable

debug

public void debug(Object message,
                  Object[] params)
Issue a log message with parameters with a level of DEBUG.

Parameters:
message - the message
params - the message parameters

debug

public void debug(Object message,
                  Object[] params,
                  Throwable t)
Issue a log message with parameters and a throwable with a level of DEBUG.

Parameters:
message - the message
params - the message parameters
t - the throwable

debug

public void debug(String loggerFqcn,
                  Object message,
                  Object[] params,
                  Throwable t)
Issue a log message with parameters and a throwable with a level of DEBUG.

Parameters:
loggerFqcn - the logger class name
message - the message
params - the message parameters
t - the throwable

debugf

public void debugf(String format,
                   Object... params)
Issue a formatted log message with a level of DEBUG.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
params - the parameters

debugf

public void debugf(String format,
                   Object param1)
Issue a formatted log message with a level of DEBUG.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the sole parameter

debugf

public void debugf(String format,
                   Object param1,
                   Object param2)
Issue a formatted log message with a level of DEBUG.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the first parameter
param2 - the second parameter

debugf

public void debugf(String format,
                   Object param1,
                   Object param2,
                   Object param3)
Issue a formatted log message with a level of DEBUG.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the first parameter
param2 - the second parameter
param3 - the third parameter

debugf

public void debugf(Throwable t,
                   String format,
                   Object... params)
Issue a formatted log message with a level of DEBUG.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
params - the parameters

debugf

public void debugf(Throwable t,
                   String format,
                   Object param1)
Issue a formatted log message with a level of DEBUG.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
param1 - the sole parameter

debugf

public void debugf(Throwable t,
                   String format,
                   Object param1,
                   Object param2)
Issue a formatted log message with a level of DEBUG.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
param1 - the first parameter
param2 - the second parameter

debugf

public void debugf(Throwable t,
                   String format,
                   Object param1,
                   Object param2,
                   Object param3)
Issue a formatted log message with a level of DEBUG.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
param1 - the first parameter
param2 - the second parameter
param3 - the third parameter

isInfoEnabled

public boolean isInfoEnabled()
Check to see if the INFO level is enabled for this logger.

Returns:
true if a info(Object) method invocation would pass the msg to the configured appenders, false otherwise.

info

public void info(Object message)
Issue a log message with a level of INFO.

Parameters:
message - the message

info

public void info(Object message,
                 Throwable t)
Issue a log message and throwable with a level of INFO.

Parameters:
message - the message
t - the throwable

info

public void info(String loggerFqcn,
                 Object message,
                 Throwable t)
Issue a log message and throwable with a level of INFO and a specific logger class name.

Parameters:
loggerFqcn - the logger class name
message - the message
t - the throwable

info

public void info(Object message,
                 Object[] params)
Issue a log message with parameters with a level of INFO.

Parameters:
message - the message
params - the message parameters

info

public void info(Object message,
                 Object[] params,
                 Throwable t)
Issue a log message with parameters and a throwable with a level of INFO.

Parameters:
message - the message
params - the message parameters
t - the throwable

info

public void info(String loggerFqcn,
                 Object message,
                 Object[] params,
                 Throwable t)
Issue a log message with parameters and a throwable with a level of INFO.

Parameters:
loggerFqcn - the logger class name
message - the message
params - the message parameters
t - the throwable

infof

public void infof(String format,
                  Object... params)
Issue a formatted log message with a level of INFO.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
params - the parameters

infof

public void infof(String format,
                  Object param1)
Issue a formatted log message with a level of INFO.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the sole parameter

infof

public void infof(String format,
                  Object param1,
                  Object param2)
Issue a formatted log message with a level of INFO.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the first parameter
param2 - the second parameter

infof

public void infof(String format,
                  Object param1,
                  Object param2,
                  Object param3)
Issue a formatted log message with a level of INFO.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the first parameter
param2 - the second parameter
param3 - the third parameter

infof

public void infof(Throwable t,
                  String format,
                  Object... params)
Issue a formatted log message with a level of INFO.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
params - the parameters

infof

public void infof(Throwable t,
                  String format,
                  Object param1)
Issue a formatted log message with a level of INFO.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
param1 - the sole parameter

infof

public void infof(Throwable t,
                  String format,
                  Object param1,
                  Object param2)
Issue a formatted log message with a level of INFO.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
param1 - the first parameter
param2 - the second parameter

infof

public void infof(Throwable t,
                  String format,
                  Object param1,
                  Object param2,
                  Object param3)
Issue a formatted log message with a level of INFO.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
param1 - the first parameter
param2 - the second parameter
param3 - the third parameter

warn

public void warn(Object message)
Issue a log message with a level of WARN.

Parameters:
message - the message

warn

public void warn(Object message,
                 Throwable t)
Issue a log message and throwable with a level of WARN.

Parameters:
message - the message
t - the throwable

warn

public void warn(String loggerFqcn,
                 Object message,
                 Throwable t)
Issue a log message and throwable with a level of WARN and a specific logger class name.

Parameters:
loggerFqcn - the logger class name
message - the message
t - the throwable

warn

public void warn(Object message,
                 Object[] params)
Issue a log message with parameters with a level of WARN.

Parameters:
message - the message
params - the message parameters

warn

public void warn(Object message,
                 Object[] params,
                 Throwable t)
Issue a log message with parameters and a throwable with a level of WARN.

Parameters:
message - the message
params - the message parameters
t - the throwable

warn

public void warn(String loggerFqcn,
                 Object message,
                 Object[] params,
                 Throwable t)
Issue a log message with parameters and a throwable with a level of WARN.

Parameters:
loggerFqcn - the logger class name
message - the message
params - the message parameters
t - the throwable

warnf

public void warnf(String format,
                  Object... params)
Issue a formatted log message with a level of WARN.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
params - the parameters

warnf

public void warnf(String format,
                  Object param1)
Issue a formatted log message with a level of WARN.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the sole parameter

warnf

public void warnf(String format,
                  Object param1,
                  Object param2)
Issue a formatted log message with a level of WARN.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the first parameter
param2 - the second parameter

warnf

public void warnf(String format,
                  Object param1,
                  Object param2,
                  Object param3)
Issue a formatted log message with a level of WARN.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the first parameter
param2 - the second parameter
param3 - the third parameter

warnf

public void warnf(Throwable t,
                  String format,
                  Object... params)
Issue a formatted log message with a level of WARN.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
params - the parameters

warnf

public void warnf(Throwable t,
                  String format,
                  Object param1)
Issue a formatted log message with a level of WARN.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
param1 - the sole parameter

warnf

public void warnf(Throwable t,
                  String format,
                  Object param1,
                  Object param2)
Issue a formatted log message with a level of WARN.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
param1 - the first parameter
param2 - the second parameter

warnf

public void warnf(Throwable t,
                  String format,
                  Object param1,
                  Object param2,
                  Object param3)
Issue a formatted log message with a level of WARN.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
param1 - the first parameter
param2 - the second parameter
param3 - the third parameter

error

public void error(Object message)
Issue a log message with a level of ERROR.

Parameters:
message - the message

error

public void error(Object message,
                  Throwable t)
Issue a log message and throwable with a level of ERROR.

Parameters:
message - the message
t - the throwable

error

public void error(String loggerFqcn,
                  Object message,
                  Throwable t)
Issue a log message and throwable with a level of ERROR and a specific logger class name.

Parameters:
loggerFqcn - the logger class name
message - the message
t - the throwable

error

public void error(Object message,
                  Object[] params)
Issue a log message with parameters with a level of ERROR.

Parameters:
message - the message
params - the message parameters

error

public void error(Object message,
                  Object[] params,
                  Throwable t)
Issue a log message with parameters and a throwable with a level of ERROR.

Parameters:
message - the message
params - the message parameters
t - the throwable

error

public void error(String loggerFqcn,
                  Object message,
                  Object[] params,
                  Throwable t)
Issue a log message with parameters and a throwable with a level of ERROR.

Parameters:
loggerFqcn - the logger class name
message - the message
params - the message parameters
t - the throwable

errorf

public void errorf(String format,
                   Object... params)
Issue a formatted log message with a level of ERROR.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
params - the parameters

errorf

public void errorf(String format,
                   Object param1)
Issue a formatted log message with a level of ERROR.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the sole parameter

errorf

public void errorf(String format,
                   Object param1,
                   Object param2)
Issue a formatted log message with a level of ERROR.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the first parameter
param2 - the second parameter

errorf

public void errorf(String format,
                   Object param1,
                   Object param2,
                   Object param3)
Issue a formatted log message with a level of ERROR.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the first parameter
param2 - the second parameter
param3 - the third parameter

errorf

public void errorf(Throwable t,
                   String format,
                   Object... params)
Issue a formatted log message with a level of ERROR.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
params - the parameters

errorf

public void errorf(Throwable t,
                   String format,
                   Object param1)
Issue a formatted log message with a level of ERROR.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
param1 - the sole parameter

errorf

public void errorf(Throwable t,
                   String format,
                   Object param1,
                   Object param2)
Issue a formatted log message with a level of ERROR.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
param1 - the first parameter
param2 - the second parameter

errorf

public void errorf(Throwable t,
                   String format,
                   Object param1,
                   Object param2,
                   Object param3)
Issue a formatted log message with a level of ERROR.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
param1 - the first parameter
param2 - the second parameter
param3 - the third parameter

fatal

public void fatal(Object message)
Issue a log message with a level of FATAL.

Parameters:
message - the message

fatal

public void fatal(Object message,
                  Throwable t)
Issue a log message and throwable with a level of FATAL.

Parameters:
message - the message
t - the throwable

fatal

public void fatal(String loggerFqcn,
                  Object message,
                  Throwable t)
Issue a log message and throwable with a level of FATAL and a specific logger class name.

Parameters:
loggerFqcn - the logger class name
message - the message
t - the throwable

fatal

public void fatal(Object message,
                  Object[] params)
Issue a log message with parameters with a level of FATAL.

Parameters:
message - the message
params - the message parameters

fatal

public void fatal(Object message,
                  Object[] params,
                  Throwable t)
Issue a log message with parameters and a throwable with a level of FATAL.

Parameters:
message - the message
params - the message parameters
t - the throwable

fatal

public void fatal(String loggerFqcn,
                  Object message,
                  Object[] params,
                  Throwable t)
Issue a log message with parameters and a throwable with a level of FATAL.

Parameters:
loggerFqcn - the logger class name
message - the message
params - the message parameters
t - the throwable

fatalf

public void fatalf(String format,
                   Object... params)
Issue a formatted log message with a level of FATAL.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
params - the parameters

fatalf

public void fatalf(String format,
                   Object param1)
Issue a formatted log message with a level of FATAL.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the sole parameter

fatalf

public void fatalf(String format,
                   Object param1,
                   Object param2)
Issue a formatted log message with a level of FATAL.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the first parameter
param2 - the second parameter

fatalf

public void fatalf(String format,
                   Object param1,
                   Object param2,
                   Object param3)
Issue a formatted log message with a level of FATAL.

Parameters:
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the first parameter
param2 - the second parameter
param3 - the third parameter

fatalf

public void fatalf(Throwable t,
                   String format,
                   Object... params)
Issue a formatted log message with a level of FATAL.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
params - the parameters

fatalf

public void fatalf(Throwable t,
                   String format,
                   Object param1)
Issue a formatted log message with a level of FATAL.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
param1 - the sole parameter

fatalf

public void fatalf(Throwable t,
                   String format,
                   Object param1,
                   Object param2)
Issue a formatted log message with a level of FATAL.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
param1 - the first parameter
param2 - the second parameter

fatalf

public void fatalf(Throwable t,
                   String format,
                   Object param1,
                   Object param2,
                   Object param3)
Issue a formatted log message with a level of FATAL.

Parameters:
t - the throwable
format - the format string, as per String.format(String, Object[])
param1 - the first parameter
param2 - the second parameter
param3 - the third parameter

log

public void log(Logger.Level level,
                Object message)
Log a message at the given level.

Parameters:
level - the level
message - the message

log

public void log(Logger.Level level,
                Object message,
                Object[] params)
Log a message at the given level.

Parameters:
level - the level
message - the message
params - the message parameters

log

public void log(Logger.Level level,
                Object message,
                Object[] params,
                Throwable t)
Log a message at the given level.

Parameters:
level - the level
message - the message
params - the message parameters
t - the throwable cause

log

public void log(String loggerFqcn,
                Logger.Level level,
                Object message,
                Object[] params,
                Throwable t)
Log a message at the given level.

Parameters:
loggerFqcn - the logger class name
level - the level
message - the message
params - the message parameters
t - the throwable cause

logf

public void logf(Logger.Level level,
                 String format,
                 Object param1)
Log a message at the given level.

Parameters:
level - the level
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the sole parameter

logf

public void logf(Logger.Level level,
                 String format,
                 Object param1,
                 Object param2)
Log a message at the given level.

Parameters:
level - the level
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the first parameter
param2 - the second parameter

logf

public void logf(Logger.Level level,
                 String format,
                 Object param1,
                 Object param2,
                 Object param3)
Log a message at the given level.

Parameters:
level - the level
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the first parameter
param2 - the second parameter
param3 - the third parameter

logf

public void logf(Logger.Level level,
                 String format,
                 Object... params)
Log a message at the given level.

Parameters:
level - the level
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
params - the message parameters

logf

public void logf(Logger.Level level,
                 Throwable t,
                 String format,
                 Object param1)
Log a message at the given level.

Parameters:
level - the level
t - the throwable cause
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the sole parameter

logf

public void logf(Logger.Level level,
                 Throwable t,
                 String format,
                 Object param1,
                 Object param2)
Log a message at the given level.

Parameters:
level - the level
t - the throwable cause
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the first parameter
param2 - the second parameter

logf

public void logf(Logger.Level level,
                 Throwable t,
                 String format,
                 Object param1,
                 Object param2,
                 Object param3)
Log a message at the given level.

Parameters:
level - the level
t - the throwable cause
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the first parameter
param2 - the second parameter
param3 - the third parameter

logf

public void logf(Logger.Level level,
                 Throwable t,
                 String format,
                 Object... params)
Log a message at the given level.

Parameters:
level - the level
t - the throwable cause
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
params - the message parameters

logf

public void logf(String loggerFqcn,
                 Logger.Level level,
                 Throwable t,
                 String format,
                 Object param1)
Log a message at the given level.

Parameters:
loggerFqcn - the logger class name
level - the level
t - the throwable cause
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the sole parameter

logf

public void logf(String loggerFqcn,
                 Logger.Level level,
                 Throwable t,
                 String format,
                 Object param1,
                 Object param2)
Log a message at the given level.

Parameters:
loggerFqcn - the logger class name
level - the level
t - the throwable cause
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the first parameter
param2 - the second parameter

logf

public void logf(String loggerFqcn,
                 Logger.Level level,
                 Throwable t,
                 String format,
                 Object param1,
                 Object param2,
                 Object param3)
Log a message at the given level.

Parameters:
loggerFqcn - the logger class name
level - the level
t - the throwable cause
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
param1 - the first parameter
param2 - the second parameter
param3 - the third parameter

logf

public void logf(String loggerFqcn,
                 Logger.Level level,
                 Throwable t,
                 String format,
                 Object... params)
Log a message at the given level.

Parameters:
loggerFqcn - the logger class name
level - the level
t - the throwable cause
format - the format string as per String.format(String, Object[]) or resource bundle key therefor
params - the message parameters

readResolve

protected final Object readResolve()
Read resolver; replaces deserialized instance with a canonical instance.

Returns:
the canonical logger instance

getI18nLogger

public static Logger getI18nLogger(String name,
                                   String resourceBundleName)
Get a logger instance with the given name using the given resource bundle (if supported by the underlying framework).

Parameters:
name - the logger category name
resourceBundleName - the resource bundle name
Returns:
the logger

getI18nLogger

public static Logger getI18nLogger(Class<?> clazz,
                                   String resourceBundleName)
Get a logger instance with the given name using the given resource bundle (if supported by the underlying framework).

Parameters:
clazz - the class whose name will be used as the logger category name
resourceBundleName - the resource bundle name
Returns:
the logger

getLogger

public static Logger getLogger(String name)
Get a Logger instance given the logger name.

Parameters:
name - the logger name
Returns:
the logger

getLogger

public static Logger getLogger(String name,
                               String suffix)
Get a Logger instance given the logger name with the given suffix.

This will include a logger seperator between classname and suffix

Parameters:
name - the logger name
suffix - a suffix to append to the classname.
Returns:
the logger

getLogger

public static Logger getLogger(Class<?> clazz)
Get a Logger instance given the name of a class. This simply calls create(clazz.getName()).

Parameters:
clazz - the Class whose name will be used as the logger name
Returns:
the logger

getLogger

public static Logger getLogger(Class<?> clazz,
                               String suffix)
Get a Logger instance given the name of a class with the given suffix.

This will include a logger seperator between classname and suffix

Parameters:
clazz - the Class whose name will be used as the logger name.
suffix - a suffix to append to the classname.
Returns:
the logger

getLoggerPlugin

public LoggerPlugin getLoggerPlugin()
Get the logger plugin.

Returns:
the logger plugin

init

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.


JBoss Logging Programming Interface 2.2.0.CR2-SNAPSHOT

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.