com.ibm.commerce.ras
Class ECLoggingProvider

java.lang.Object
  |
  +--com.ibm.commerce.ras.ECLoggingProvider
All Implemented Interfaces:
ILoggingService

public final class ECLoggingProvider
extends java.lang.Object
implements ILoggingService

ECLoggingProvider is used to configure the messages and write to output.


Field Summary
static java.lang.String COPYRIGHT
          IBM copyright notice field.
 
Method Summary
 void disable(long messageSeverity)
          Disables a specific message severity based on the message severity Id.
 void disable(java.lang.String messageSeverity)
          Disables a specific message severity based on the message severity name.
 void disableLogging()
          Disables message logging.
 void enable(long messageSeverity)
          Enables a specific message severity based on the message severity Id.
 void enable(java.lang.String messageSeverity)
          Enable a specific message severity based on the message severity name.
 void enableLogging()
          Enables message logging.
protected  void finalize()
          Performs garbage collect when ECMessageLog is no longer referenced.
static java.lang.String getNotificationClassName()
          Gets the class name of Error Notification
static long getSeverity(java.lang.Object sev)
          Gets the message Severity Id based on the severity name.
static  ECLoggingProvider getUniqueInstance()
          Gets the unique instance of the ECLoggingProvider class.
 boolean isLoggable(ECMessage msg)
          Determines if the given message object will be processed by the logger and any of the handlers.
static boolean isLoggable(long type)
          Determines if the specified logging severity type will be processed by the logger and any of the handlers.
 boolean isLoggingEnabled()
          Checks if the message logging is enabled.
 void out(ECMessage msg, java.lang.String className, java.lang.String methodName)
          Writes the specified ECMessage to the log file.
 void out(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.Object[] parms)
          Writes the specified ECMessage to the log file.
 void out(ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.Object[] parms, java.lang.Throwable exc)
          Writes the specified ECMessage to the log file.
 void outputMessage( ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.Object[] params)
          Writes the specified ECMessage to the log file.
 void outputMessage( ECMessage msg, java.lang.String className, java.lang.String methodName, java.lang.Object[] params, java.lang.Throwable exception)
          Writes the specified ECMessage to the log file.
 void overrideMask(long messageSeverity)
          Overrides the message mask to keep track of which message severities will be logged.
static void setNotificationClassName(java.lang.String name)
          Sets the error notification class name.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail
public static final java.lang.String COPYRIGHT
IBM copyright notice field.
See Also:
Constant Field Values
Method Detail

disable

public void disable(long messageSeverity)
Disables a specific message severity based on the message severity Id. All messages with the specified severity will not be logged.
Specified by:
disable in interface ILoggingService
Parameters:
messageSeverity - message severity id to be disabled

disable

public void disable(java.lang.String messageSeverity)
Disables a specific message severity based on the message severity name. All messages with the specified severity will not be logged.
Specified by:
disable in interface ILoggingService
Parameters:
messageSeverity - message severity to be disabled

disableLogging

public void disableLogging()
Disables message logging. No error message will be logged.
Specified by:
disableLogging in interface ILoggingService

enable

public void enable(long messageSeverity)
Enables a specific message severity based on the message severity Id.
Specified by:
enable in interface ILoggingService
Parameters:
messageSeverity - message severity Id to be enabled

enable

public void enable(java.lang.String messageSeverity)
Enable a specific message severity based on the message severity name.
Specified by:
enable in interface ILoggingService
Parameters:
messageSeverity - message severity to be enabled

enableLogging

public void enableLogging()
Enables message logging.
Specified by:
enableLogging in interface ILoggingService

finalize

protected void finalize()
Performs garbage collect when ECMessageLog is no longer referenced.
Overrides:
finalize in class java.lang.Object

getNotificationClassName

public static java.lang.String getNotificationClassName()
Gets the class name of Error Notification
Returns:
class name of the error notification

getSeverity

public static long getSeverity(java.lang.Object sev)
Gets the message Severity Id based on the severity name. There are five type of severity: ERROR, DEBUG, WARNING, STATUS, INFO
Parameters:
sev - message severity name
Returns:
message severity Id

getUniqueInstance

public static ECLoggingProvider getUniqueInstance()
Gets the unique instance of the ECLoggingProvider class.
Returns:
ECLoggingProvider instance

isLoggable

public static boolean isLoggable(long type)
Determines if the specified logging severity type will be processed by the logger and any of the handlers.
Parameters:
type - the message severity type
Returns:
true if the logger is enabled and at least one handler will process the message severity type; false otherwise.

isLoggable

public boolean isLoggable(ECMessage msg)
Determines if the given message object will be processed by the logger and any of the handlers.
Specified by:
isLoggable in interface ILoggingService
Parameters:
msg - the message object
Returns:
true if the logger is enabled and at least one handler will process the message; false otherwise.

isLoggingEnabled

public boolean isLoggingEnabled()
Checks if the message logging is enabled.
Specified by:
isLoggingEnabled in interface ILoggingService
Returns:
true if the message logging is enabled; false otherwise

out

public void out(ECMessage msg,
                java.lang.String className,
                java.lang.String methodName)
Writes the specified ECMessage to the log file.
Specified by:
out in interface ILoggingService
Parameters:
msg - the ECMessage object whose text is written to the log
methodName - the name of the method that issued the logging of this ECMessage

out

public void out(ECMessage msg,
                java.lang.String className,
                java.lang.String methodName,
                java.lang.Object[] parms)
Writes the specified ECMessage to the log file.
Specified by:
out in interface ILoggingService
Parameters:
msg - the ECMessage object whose text is written to the log
methodName - the name of the method that issued the logging of this ECMessage
parms - the list of parameters that will be substituted into the message text

out

public void out(ECMessage msg,
                java.lang.String className,
                java.lang.String methodName,
                java.lang.Object[] parms,
                java.lang.Throwable exc)
Writes the specified ECMessage to the log file.
Specified by:
out in interface ILoggingService
Parameters:
msg - the ECMessage object whose text is written to the log
methodName - the name of the method that issued the logging of this ECMessage
parms - the list of parameters that will be substituted into the message text

outputMessage

public void outputMessage(ECMessage msg,
                          java.lang.String className,
                          java.lang.String methodName,
                          java.lang.Object[] params)
Writes the specified ECMessage to the log file.
Parameters:
msg - the ECMessage object whose text is written to the log
methodName - the name of the method that issued the logging of this ECMessage

outputMessage

public void outputMessage(ECMessage msg,
                          java.lang.String className,
                          java.lang.String methodName,
                          java.lang.Object[] params,
                          java.lang.Throwable exception)
Writes the specified ECMessage to the log file.
Parameters:
msg - the ECMessage object whose text is written to the log.
methodName - the name of the method that issued the logging of this ECMessage
exception - Throwable exception associated to the error message.

overrideMask

public void overrideMask(long messageSeverity)
Overrides the message mask to keep track of which message severities will be logged.

setNotificationClassName

public static void setNotificationClassName(java.lang.String name)
Sets the error notification class name.
Parameters:
name - the class name for the error notification