com.arjuna.common.util.logging
Interface Logi18n


public interface Logi18n

Internationalised logging interface abstracting the various logging APIs supported by Arjuna CLF.

The five logging levels used by Log are (in order):

  1. debug (the least serious
  2. info
  3. warn
  4. error
  5. fatal (the most serious)
The mapping of these log levels to the concepts used by the underlying logging system is implementation dependent. The implemention should ensure, though, that this ordering behaves as expected.

Performance is often a logging concern. By examining the appropriate property, a component can avoid expensive operations (producing information to be logged).

For example,

    if (log.isDebugEnabled()) {
        ... do something expensive ...
        log.debug(theResult);
    }
 

Configuration of the underlying logging system will generally be done external to the Logging APIs, through whatever mechanism is supported by that system.

Since:
clf-2.0
Version:
$Revision: 2342 $ $Date: 2006-03-30 14:06:17 +0100 (Thu, 30 Mar 2006) $
Author:
Thomas Rischbeck

Method Summary
 void debug(java.lang.String key)
          Log a message with DEBUG Level
 void debug(java.lang.String key, java.lang.Object[] params)
          Log a message with DEBUG Level and with arguments
 void debug(java.lang.String key, java.lang.Object[] params, java.lang.Throwable throwable)
          Log a message with DEBUG Level, with arguments and with a throwable arguments
 void debug(java.lang.String key, java.lang.Throwable throwable)
          Log a message with the DEBUG Level and with a throwable arguments
 void error(java.lang.String key)
          Log a message with the ERROR Level
 void error(java.lang.String key, java.lang.Object[] params)
          Log a message with the ERROR Level and with arguments
 void error(java.lang.String key, java.lang.Object[] params, java.lang.Throwable throwable)
          Log a message with the ERROR Level, with arguments and with a throwable arguments
 void error(java.lang.String key, java.lang.Throwable throwable)
          Log a message with the ERROR Level and with a throwable arguments
 void fatal(java.lang.String key)
          Log a message with the FATAL Level
 void fatal(java.lang.String key, java.lang.Object[] params)
          Log a message with the FATAL Level and with arguments
 void fatal(java.lang.String key, java.lang.Object[] params, java.lang.Throwable throwable)
          Log a message with the FATAL Level, with arguments and with a throwable arguments
 void fatal(java.lang.String key, java.lang.Throwable throwable)
          Log a message with the FATAL Level and with a throwable arguments
 java.lang.String getString(java.lang.String key)
          Obtain a localized message from one of the resource bundles associated with this logger.
 java.lang.String getString(java.lang.String key, java.lang.Object[] params)
          Obtain a localized and parameterized message from one of the resource bundles associated with this logger.
 void info(java.lang.String key)
          Log a message with INFO Level
 void info(java.lang.String key, java.lang.Object[] params)
          Log a message with the INFO Level and with arguments
 void info(java.lang.String key, java.lang.Object[] params, java.lang.Throwable throwable)
          Log a message with the INFO Level, with arguments and with a throwable arguments
 void info(java.lang.String key, java.lang.Throwable throwable)
          Log a message with the INFO Level and with a throwable arguments
 boolean isDebugEnabled()
          Determine if this logger is enabled for DEBUG messages.
 boolean isErrorEnabled()
          Determine if this logger is enabled for ERROR messages.
 boolean isFatalEnabled()
          Determine if this logger is enabled for FATAL messages.
 boolean isInfoEnabled()
          Determine if this logger is enabled for INFO messages.
 boolean isWarnEnabled()
          Determine if this logger is enabled for WARN messages.
 void warn(java.lang.String key)
          Log a message with the WARN Level
 void warn(java.lang.String key, java.lang.Object[] params)
          Log a message with the WARN Level and with arguments
 void warn(java.lang.String key, java.lang.Object[] params, java.lang.Throwable throwable)
          Log a message with the WARN Level, with arguments and with a throwable arguments
 void warn(java.lang.String key, java.lang.Throwable throwable)
          Log a message with the WARN Level and with a throwable arguments
 

Method Detail

isDebugEnabled

boolean isDebugEnabled()
Determine if this logger is enabled for DEBUG messages. This method returns true when the underlying logger is configured with DEBUG level on.

Returns:
True if the logger is enabled for DEBUG, false otherwise

isInfoEnabled

boolean isInfoEnabled()
Determine if this logger is enabled for INFO messages.

Returns:
True if the logger is enabled for INFO, false otherwise

isWarnEnabled

boolean isWarnEnabled()
Determine if this logger is enabled for WARN messages.

Returns:
True if the logger is enabled for WARN, false otherwise

isErrorEnabled

boolean isErrorEnabled()
Determine if this logger is enabled for ERROR messages.

Returns:
True if the logger is enabled for ERROR, false otherwise

isFatalEnabled

boolean isFatalEnabled()
Determine if this logger is enabled for FATAL messages.

Returns:
True if the logger is enabled for FATAL, false otherwise

debug

void debug(java.lang.String key)
Log a message with DEBUG Level

Parameters:
key - resource bundle key for the message to log

debug

void debug(java.lang.String key,
           java.lang.Throwable throwable)
Log a message with the DEBUG Level and with a throwable arguments

Parameters:
key - resource bundle key for the message to log
throwable - The Throwable to log

debug

void debug(java.lang.String key,
           java.lang.Object[] params)
Log a message with DEBUG Level and with arguments

Parameters:
key - resource bundle key for the message to log
params - parameters passed to the message

debug

void debug(java.lang.String key,
           java.lang.Object[] params,
           java.lang.Throwable throwable)
Log a message with DEBUG Level, with arguments and with a throwable arguments

Parameters:
key - resource bundle key for the message to log
params - parameters passed to the message
throwable - The Throwable to log

info

void info(java.lang.String key)
Log a message with INFO Level

Parameters:
key - resource bundle key for the message to log

info

void info(java.lang.String key,
          java.lang.Throwable throwable)
Log a message with the INFO Level and with a throwable arguments

Parameters:
key - resource bundle key for the message to log
throwable - Throwable associated to the logging message

info

void info(java.lang.String key,
          java.lang.Object[] params)
Log a message with the INFO Level and with arguments

Parameters:
key - resource bundle key for the message to log
params - parameters passed to the message

info

void info(java.lang.String key,
          java.lang.Object[] params,
          java.lang.Throwable throwable)
Log a message with the INFO Level, with arguments and with a throwable arguments

Parameters:
key - resource bundle key for the message to log
params - parameters passed to the message
throwable - Throwable associated with the logging request

warn

void warn(java.lang.String key)
Log a message with the WARN Level

Parameters:
key - resource bundle key for the message to log

warn

void warn(java.lang.String key,
          java.lang.Throwable throwable)
Log a message with the WARN Level and with a throwable arguments

Parameters:
key - resource bundle key for the message to log
throwable - Throwable associated with the logging request

warn

void warn(java.lang.String key,
          java.lang.Object[] params)
Log a message with the WARN Level and with arguments

Parameters:
key - resource bundle key for the message to log
params - parameters passed to the message

warn

void warn(java.lang.String key,
          java.lang.Object[] params,
          java.lang.Throwable throwable)
Log a message with the WARN Level, with arguments and with a throwable arguments

Parameters:
key - resource bundle key for the message to log
params - parameters passed to the message
throwable - Throwable associated with the logging request

error

void error(java.lang.String key)
Log a message with the ERROR Level

Parameters:
key - resource bundle key for the message to log

error

void error(java.lang.String key,
           java.lang.Throwable throwable)
Log a message with the ERROR Level and with a throwable arguments

Parameters:
key - resource bundle key for the message to log
throwable - Throwable associated with the logging request

error

void error(java.lang.String key,
           java.lang.Object[] params)
Log a message with the ERROR Level and with arguments

Parameters:
key - resource bundle key for the message to log
params - parameters passed to the message

error

void error(java.lang.String key,
           java.lang.Object[] params,
           java.lang.Throwable throwable)
Log a message with the ERROR Level, with arguments and with a throwable arguments

Parameters:
key - resource bundle key for the message to log
params - parameters passed to the message
throwable - Throwable associated with the logging request

fatal

void fatal(java.lang.String key)
Log a message with the FATAL Level

Parameters:
key - resource bundle key for the message to log

fatal

void fatal(java.lang.String key,
           java.lang.Throwable throwable)
Log a message with the FATAL Level and with a throwable arguments

Parameters:
key - resource bundle key for the message to log
throwable - Throwable associated with the logging request

fatal

void fatal(java.lang.String key,
           java.lang.Object[] params)
Log a message with the FATAL Level and with arguments

Parameters:
key - resource bundle key for the message to log
params - parameters passed to the message

fatal

void fatal(java.lang.String key,
           java.lang.Object[] params,
           java.lang.Throwable throwable)
Log a message with the FATAL Level, with arguments and with a throwable arguments

Parameters:
key - resource bundle key for the message to log
params - parameters passed to the message
throwable - Throwable associated with the logging request

getString

java.lang.String getString(java.lang.String key)
Obtain a localized message from one of the resource bundles associated with this logger. The user supplied parameter key is replaced by its localized version from the resource bundle.

Parameters:
key - unique key to identify an entry in the resource bundle.
Returns:
The localised string according to user's locale and available resource bundles. placeholder message if the resource bundle or key cannot be found.

getString

java.lang.String getString(java.lang.String key,
                           java.lang.Object[] params)
Obtain a localized and parameterized message from one of the resource bundles associated with this logger. First, the user supplied key is searched in the resource bundle. Next, the resulting pattern is formatted using MessageFormat.format(String,Object[]) method with the user supplied object array params.

Parameters:
key - unique key to identify an entry in the resource bundle.
params - parameters to fill placeholders (e.g., {0}, {1}) in the resource bundle string.
Returns:
The localised string according to user's locale and available resource bundles. placeholder message if the resource bundle or key cannot be found.