com.ibm.twss.platform
Class ServicePlatformLogger

java.lang.Object
  extended by com.ibm.twss.platform.ServicePlatformLogger

public class ServicePlatformLogger
extends java.lang.Object

Service Platform Logger object.

Version:
1.1

Field Summary
static int TRACE_ALL
          Used for all logged messages.
static int TRACE_FINE
          Provides basic tracing information.
static int TRACE_FINER
          Provides fairly detailed tracing information.
static int TRACE_FINEST
          Provides the highest level of tracing detail.
static int TRACE_INFO
          Used for informational messages.
static int TRACE_OFF
          Turns off tracing.
static int TRACE_SEVERE
          Used for severe messages.
static int TRACE_WARNING
          Used for warning messages.
 
Method Summary
static ServicePlatformLogger getLogger(java.lang.Class cls)
          Creates a wrapped trace logger for use in logging information about class method execution.
 boolean isLoggingEnabled(int level)
          Indicates whether this logging level is enabled.
 void log(int level, java.lang.String method, java.lang.String msg)
          Generic logging method that allows for logging at any level.
 void log(int level, java.lang.String method, java.lang.String msg, java.lang.Object param)
          Generic logging method that allows for logging at any level, and includes a single object parameter to the log message.
 void log(int level, java.lang.String method, java.lang.String msg, java.lang.Object[] params)
          Generic logging method that allows for logging at any level, and includes a list of parameters to substitute within the message.
 void logException(java.lang.String method, java.lang.Exception ex)
          Logs an exception to the console.
 void logException(java.lang.String method, java.lang.Exception ex, java.lang.Object ox)
          Logs an exception to the console.
 void logInfo(java.lang.String method, java.lang.String s)
          Logs informational messages that are intended to be read by operators, system administrations, and service people.
 void logSevere(java.lang.String method, java.lang.String s)
          Logs severe messages that are intended to be read by operators, system administrations, and service people.
 void logWarning(java.lang.String method, java.lang.String s)
          Logs warning messages that are intended to be read by operators, system administrations, and service people.
 void trace(int traceLevel, java.lang.String method, java.lang.String s)
          Outputs trace information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRACE_OFF

public static final int TRACE_OFF
Turns off tracing.

See Also:
Constant Field Values

TRACE_FINE

public static final int TRACE_FINE
Provides basic tracing information.

See Also:
Constant Field Values

TRACE_FINER

public static final int TRACE_FINER
Provides fairly detailed tracing information.

See Also:
Constant Field Values

TRACE_FINEST

public static final int TRACE_FINEST
Provides the highest level of tracing detail.

See Also:
Constant Field Values

TRACE_INFO

public static final int TRACE_INFO
Used for informational messages.

See Also:
Constant Field Values

TRACE_SEVERE

public static final int TRACE_SEVERE
Used for severe messages.

See Also:
Constant Field Values

TRACE_WARNING

public static final int TRACE_WARNING
Used for warning messages.

See Also:
Constant Field Values

TRACE_ALL

public static final int TRACE_ALL
Used for all logged messages.

See Also:
Constant Field Values
Method Detail

getLogger

public static ServicePlatformLogger getLogger(java.lang.Class cls)
Creates a wrapped trace logger for use in logging information about class method execution. The level of this logger is inherited from the parent logger.

Parameters:
cls - The name of the class associated with this logger
Returns:
A trace logger instance

isLoggingEnabled

public boolean isLoggingEnabled(int level)
Indicates whether this logging level is enabled. This should be called before creating any objects used to populate logging messages.

Parameters:
level - The level to log
Returns:
True if this level is enabled

log

public void log(int level,
                java.lang.String method,
                java.lang.String msg)
Generic logging method that allows for logging at any level.

Parameters:
level - The logging level to use
method - The method performing hte logging
msg - The message to log

log

public void log(int level,
                java.lang.String method,
                java.lang.String msg,
                java.lang.Object param)
Generic logging method that allows for logging at any level, and includes a single object parameter to the log message.

Parameters:
level - The logging level to use
method - The method performing the logging
msg - The message to log
param - The object parameter to substitute in the message

log

public void log(int level,
                java.lang.String method,
                java.lang.String msg,
                java.lang.Object[] params)
Generic logging method that allows for logging at any level, and includes a list of parameters to substitute within the message.

Parameters:
level - The logging level to use
method - The method performing the logging
msg - The message to log
params - The parameters to substitute in the form of {0}, {1}, etc.

logInfo

public void logInfo(java.lang.String method,
                    java.lang.String s)
Logs informational messages that are intended to be read by operators, system administrations, and service people.

Parameters:
method - The method from where the logging is being performed
s - The message string

trace

public void trace(int traceLevel,
                  java.lang.String method,
                  java.lang.String s)
Outputs trace information. Trace information can be classified into three levels: FINE, FINER, and FINEST. The appropriate level should be chosen at the developers discretion. Any other trace levels will result in a no-op.

Parameters:
method - The method from where the logging is being performed
s - The message string

logWarning

public void logWarning(java.lang.String method,
                       java.lang.String s)
Logs warning messages that are intended to be read by operators, system administrations, and service people.

Parameters:
method - The method from where the logging is being performed
s - The message string

logSevere

public void logSevere(java.lang.String method,
                      java.lang.String s)
Logs severe messages that are intended to be read by operators, system administrations, and service people.

Parameters:
method - The method from where the logging is being performed
s - The message string

logException

public void logException(java.lang.String method,
                         java.lang.Exception ex)
Logs an exception to the console. An exception will be output if tracing is set to finest. Always outputs FFDC information when logging the exception.

Parameters:
method - THe method logging the exception
ex - The exception being logged

logException

public void logException(java.lang.String method,
                         java.lang.Exception ex,
                         java.lang.Object ox)
Logs an exception to the console. An exception will be output if tracing is set to finest. Always outputs FFDC information when logging the exception.

Parameters:
method - THe method logging the exception
ex - The exception being logged
ox - The object to write to the FFDC log


Copyright © 2003 IBM Corp. All Rights Reserved.