com.ibm.wps.portlets.struts.logging
Class WpsStrutsTraceLogger

java.lang.Object
  extended by com.ibm.wps.portlets.struts.logging.WpsStrutsTraceLogger

public class WpsStrutsTraceLogger
extends java.lang.Object

This class provides logging ability using six different logging levels.

The six logging levels used are (in order):

  1. trace (the least serious)
  2. debug
  3. info
  4. warn
  5. error
  6. fatal (the most serious)

Since:
5.1

Field Summary
static int DEBUG
          "Debug" level logging.
static int ERROR
          "Error" level logging.
static int FATAL
          "Fatal" level logging.
static int INFO
          "Info" level logging.
static int TRACE
          "Trace" level logging.
static int WARN
          "Warn" level logging.
 
Constructor Summary
WpsStrutsTraceLogger(java.lang.Class aClass)
          Constructor.
WpsStrutsTraceLogger(java.lang.String classname)
          Constructor.
 
Method Summary
 void entry(int logLevel, java.lang.String loggingMethod)
          Logs an entry message at the specified log level indicating that the method has been entered.
 void exit(int logLevel, java.lang.String loggingMethod)
          Logs an exit message at the specified log level indicating that the method is exiting.
 boolean isLogging(int logLevel)
          Return true if logging is enabled for a particular log level.
 void stackTrace(int logLevel, java.lang.String loggingMethod, java.lang.String text)
          Stack Trace
 void text(int logLevel, java.lang.String loggingMethod, java.lang.String text)
          Logs a message at the specified log level.
 void text(int logLevel, java.lang.String loggingMethod, java.lang.String text, java.lang.Throwable t)
          Logs a message at the specified log level.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TRACE

public static int TRACE
"Trace" level logging.


DEBUG

public static int DEBUG
"Debug" level logging.


INFO

public static int INFO
"Info" level logging.


WARN

public static int WARN
"Warn" level logging.


ERROR

public static int ERROR
"Error" level logging.


FATAL

public static int FATAL
"Fatal" level logging.

Constructor Detail

WpsStrutsTraceLogger

public WpsStrutsTraceLogger(java.lang.Class aClass)
Constructor.

Parameters:
class - The logger class

WpsStrutsTraceLogger

public WpsStrutsTraceLogger(java.lang.String classname)
Constructor.

Parameters:
class - The logger class name
Method Detail

isLogging

public boolean isLogging(int logLevel)
Return true if logging is enabled for a particular log level.

Parameters:
logLevel - The log level
Returns:
returns true or false, depending on whether the level of logging is enabled

text

public void text(int logLevel,
                 java.lang.String loggingMethod,
                 java.lang.String text)
Logs a message at the specified log level. The message is the concatenation of the method and the text.

Parameters:
logLevel - The log level
loggingMethod - The logging method
text - The logging text

text

public void text(int logLevel,
                 java.lang.String loggingMethod,
                 java.lang.String text,
                 java.lang.Throwable t)
Logs a message at the specified log level. The message is the concatenation of the method and the text.

Parameters:
logLevel - the log level
loggingMethod - the logging method
text - the logging text
t - The exception whose stack trace should be logged

entry

public void entry(int logLevel,
                  java.lang.String loggingMethod)
Logs an entry message at the specified log level indicating that the method has been entered.

Parameters:
logLevel - The log level
loggingMethod - The logging method

exit

public void exit(int logLevel,
                 java.lang.String loggingMethod)
Logs an exit message at the specified log level indicating that the method is exiting. Use this method immediately before it exits.

Parameters:
logLevel - The log level
loggingMethod - The logging method

stackTrace

public void stackTrace(int logLevel,
                       java.lang.String loggingMethod,
                       java.lang.String text)
Stack Trace

Parameters:
logLevel - The log level
loggingMethod - The logging method
text - The logging text