|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.ras.RASObject | +--com.ibm.ras.RASMaskChangeGenerator | +--com.ibm.ras.RASLogger | +--com.ibm.ras.RASMessageLogger | +--com.ibm.websphere.ras.WsJrasMessageLogger
The WsJRasMessageLogger class extends the
RASMessageLogger
class and implements the
RASIMessageLogger
interface. Users must not directly create an
instance of a WsJRasMessageLogger. Instead, the
Manager
class must be used to obtain an instance.
A WsJrasMessageLogger can be used to publish a message to both the WebSphere run time as well as user-defined message consumers. Messages published to the WebSphere run time are viewed and managed using the normal WebSphere message viewing and management facilities. By default, message logging is enabled when a WsJrasMessageLogger is created.
Four basic message logging methods are provided by the
RASIMessageLogger
interface. They are message, msg,
textMessage and exception
. These methods all include the name of the class and
method which generated the message. When logging messages in non-static methods, methods that take
the "this" (the object performing the logging) as the second parameter can be used. This is a
convenience to the programmer, as the class name can be derived from any Object.
For static methods, an object does not exist. The methods which take "String className"
as the second parameter should be used in this case. Of course, this latter approach may be used in
all methods, if desired. It will result in better performance (significant if many messages are
logged), as the RAS system will not have to translate an Object to a class name.
A base set of message types is defined in the RASIMessageEvent
class. Users may define their own types by extending this class, but messages of user defined types
are ignored by the WebSphere run time. In addition, the base types may be mapped to native types
depending on the WebSphere platform. Consult the user documentation for WebSphere edition you are
running on for a description of any such mappings.
Normally, the text for a set of messages is stored in one or more message files, known as a ResourceBundle. Usage of the Property resource bundle pattern is recommended.
WsJrasMessageLogger provides support for the logging of plain text messages which do not use message catalogs via the textMessage methods. This allows the passing of messages that are already localized. In addition, they can be used as a convenience by the application developer who might want to log a quick debug message that will not make it into the final product. The textMessage method takes an arbitrary text string in place of a message key. Objects may be included with the message, but they are simply displayed with the message text (according to their toString representation), not substituted into the message text.
WsJrasMessageLogger has several other fields which may be included in the message. These
fields should not vary among messages produced by a given WsJrasMessageLogger, so they are
not included in the methods of this class. They are specified when the WsJrasMessageLogger
is obtained from the Manager
or by the appropriate
"set" and "get" methods of this class. These fields are:
If not specified, each of these fields defaults to an empty string.
RASIMessageLogger
,
RASMessageLogger
,
RASIMessageEvent
,
RASMessageEvent
,
RASIHandler
, Serialized FormFields inherited from class com.ibm.ras.RASLogger |
---|
handlerFailures, isLoggableMask, isLogging |
Fields inherited from interface com.ibm.ras.RASIMessageEvent |
---|
ALL_MESSAGE_MASK, DEFAULT_MESSAGE_MASK, TYPE_ERR, TYPE_ERROR, TYPE_INFO, TYPE_INFORMATION, TYPE_WARN, TYPE_WARNING |
Method Summary | |
---|---|
void |
addHandler(RASIHandler handler)
Add a RASIHandler object to the list of Handlers to which this MessageLogger will forward events. |
void |
addTraceEventClass(java.lang.String name)
Add the specified name of a trace event class to the list of trace event classes which this object uses. |
void |
exception(long type,
java.lang.Object obj,
java.lang.String methodName,
java.lang.Exception exception)
Log an Exception in a non-static method. |
void |
exception(long type,
java.lang.Object obj,
java.lang.String methodName,
java.lang.Throwable throwable)
Log an Exception in a non-static method. |
void |
exception(long type,
java.lang.String className,
java.lang.String methodName,
java.lang.Exception exception)
Log an Exception in a static method. |
void |
exception(long type,
java.lang.String className,
java.lang.String methodName,
java.lang.Throwable throwable)
Log an Exception in a static method. |
java.lang.String |
getGroup()
Return the name of the RASManager group with which this object is associated. |
long |
getTraceMask()
Return the current value of the trace mask for this MessageLogger. |
protected void |
init()
Initialize this object, setting default values. |
boolean |
isSynchronous()
Return a boolean indicating whether or not synchronous logging is in effect. |
void |
message(long type,
java.lang.Object obj,
java.lang.String methodName,
java.lang.String key)
Log a message, by key, with no parameters. |
void |
message(long type,
java.lang.Object obj,
java.lang.String methodName,
java.lang.String key,
java.lang.Object parm1)
Log a message, by key, with one parameter. |
void |
message(long type,
java.lang.Object obj,
java.lang.String methodName,
java.lang.String key,
java.lang.Object[] parms)
Log a message, by key, with an array of parameters. |
void |
message(long type,
java.lang.Object obj,
java.lang.String methodName,
java.lang.String key,
java.lang.Object parm1,
java.lang.Object parm2)
Log a message, by key, with two parameters. |
void |
message(long type,
java.lang.String className,
java.lang.String methodName,
java.lang.String key)
Log a message, by key, with no parameters. |
void |
message(long type,
java.lang.String className,
java.lang.String methodName,
java.lang.String key,
java.lang.Object parm1)
Log a message, by key, with one parameter. |
void |
message(long type,
java.lang.String className,
java.lang.String methodName,
java.lang.String key,
java.lang.Object[] parms)
Log a message, by key, with an array of parameters. |
void |
message(long type,
java.lang.String className,
java.lang.String methodName,
java.lang.String key,
java.lang.Object parm1,
java.lang.Object parm2)
Log a message, by key, with two parameters. |
void |
msg(long type,
java.lang.Object obj,
java.lang.String methodName,
java.lang.String key,
java.lang.String file)
Log a message, by key and file, with no parameters. |
void |
msg(long type,
java.lang.Object obj,
java.lang.String methodName,
java.lang.String key,
java.lang.String file,
java.lang.Object parm1)
Log a message, by key and file with one parameter. |
void |
msg(long type,
java.lang.Object obj,
java.lang.String methodName,
java.lang.String key,
java.lang.String file,
java.lang.Object[] parms)
Log a message, by key and file, with an array of parameters. |
void |
msg(long type,
java.lang.Object obj,
java.lang.String methodName,
java.lang.String key,
java.lang.String file,
java.lang.Object parm1,
java.lang.Object parm2)
Log a message, by key and file, with two parameters. |
void |
msg(long type,
java.lang.String className,
java.lang.String methodName,
java.lang.String key,
java.lang.String file)
Log a message, by key and file, with no parameters. |
void |
msg(long type,
java.lang.String className,
java.lang.String methodName,
java.lang.String key,
java.lang.String file,
java.lang.Object parm1)
Log a message, by key and file, with one parameter. |
void |
msg(long type,
java.lang.String className,
java.lang.String methodName,
java.lang.String key,
java.lang.String file,
java.lang.Object[] parms)
Log a message, by key and file, with an array of parameters. |
void |
msg(long type,
java.lang.String className,
java.lang.String methodName,
java.lang.String key,
java.lang.String file,
java.lang.Object parm1,
java.lang.Object parm2)
Log a message, by key and file, with two parameters. |
void |
removeHandler(RASIHandler handler)
Remove a RASIHandler object from the list of Handlers to which this MessageLogger will forward events. |
void |
removeTraceEventClass(java.lang.String name)
Remove the specified name of a trace event class from the list of trace event classes which this object uses. |
void |
setLogging(boolean flag)
Set the isLogging boolean to the indicated state. |
void |
setLoggingOutput(java.lang.String file)
Set the name of the file to which log entries will be written |
void |
setName(java.lang.String name)
Set the name by which this MessageLogger is known. |
void |
setSynchronous(boolean flag)
Set a flag that tells the logger whether to log data synchronously. |
void |
setTraceMask(long mask)
Set the value of the trace mask for this logger. |
void |
textMessage(long type,
java.lang.Object obj,
java.lang.String methodName,
java.lang.String text)
Log a text message (no key) with no parameters. |
void |
textMessage(long type,
java.lang.Object obj,
java.lang.String methodName,
java.lang.String text,
java.lang.Object parm1)
Log a text message (no key) with one parameter. |
void |
textMessage(long type,
java.lang.Object obj,
java.lang.String methodName,
java.lang.String text,
java.lang.Object[] parms)
Log a text message (no key) with an array of parameters. |
void |
textMessage(long type,
java.lang.Object obj,
java.lang.String methodName,
java.lang.String text,
java.lang.Object parm1,
java.lang.Object parm2)
Log a text message (no key) with two parameters. |
void |
textMessage(long type,
java.lang.String className,
java.lang.String methodName,
java.lang.String text)
Log a text message (no key) with no parameters. |
void |
textMessage(long type,
java.lang.String className,
java.lang.String methodName,
java.lang.String text,
java.lang.Object parm1)
Log a text message (no key) with one parameter. |
void |
textMessage(long type,
java.lang.String className,
java.lang.String methodName,
java.lang.String text,
java.lang.Object[] parms)
Log a text message (no key) with an array of parameters. |
void |
textMessage(long type,
java.lang.String className,
java.lang.String methodName,
java.lang.String text,
java.lang.Object parm1,
java.lang.Object parm2)
Log a text message (no key) with two parameters. |
Methods inherited from class com.ibm.ras.RASMessageLogger |
---|
addSuppressedKey, getComponent, getConfig, getMessageFile, getOrganization, getProduct, getSuppressedKeys, logMsg, maskValueChanged, removeSuppressedKey, setComponent, setConfig, setMessageFile, setOrganization, setProduct |
Methods inherited from class com.ibm.ras.RASLogger |
---|
fireRASEvent, getClient, getHandlers, getServer, isLoggable, isLogging, setClient, setServer |
Methods inherited from class com.ibm.ras.RASObject |
---|
clone, getDescription, getName, setDescription |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.ibm.CORBA.iiop.OrbMsgLogger |
---|
getMessageFile, isLoggable, setMessageFile |
Methods inherited from interface com.ibm.ras.RASIMessageLogger |
---|
getMessageMask, setMessageMask |
Methods inherited from interface com.ibm.ras.RASILogger |
---|
fireRASEvent, getClient, getHandlers, getServer, isLoggable, isLogging, setClient, setServer |
Methods inherited from interface com.ibm.ras.RASIMaskChangeGenerator |
---|
addMaskChangeListener, addMessageEventClass, fireMaskChangedEvent, getMaskChangeListeners, getMessageEventClasses, getTraceEventClasses, removeMaskChangeListener, removeMessageEventClass |
Methods inherited from interface com.ibm.ras.RASIObject |
---|
getDescription, getName, setDescription |
Method Detail |
protected void init()
init
in class RASMessageLogger
public void setLoggingOutput(java.lang.String file)
WebSphere will redirect Orb message entries to internal logs. This method is a no operation.
setLoggingOutput
in interface com.ibm.CORBA.iiop.OrbMsgLogger
file
- the name of a file. Ignored.public void setName(java.lang.String name)
The name of the WebSphere logger is set at construction time and must not be modified by the user. Calling this method results in no operation.
setName
in class RASObject
name
- The name of this object. Input is ignored.public java.lang.String getGroup()
NOTE: This method may only be called by the RAS Manager.
getGroup
in class RASObject
public long getTraceMask()
The trace mask defines the set of trace types that will be processed. By definition, message loggers do not process trace types, this value will always be zero.
getTraceMask
in class RASMaskChangeGenerator
public void setTraceMask(long mask)
The trace mask defines the set of trace types that will be processed. By definition, message loggers do not process trace types, this is always a no-operation.
setTraceMask
in class RASMaskChangeGenerator
mask
- The trace mask. Input is ignoredpublic void addTraceEventClass(java.lang.String name)
By definition, MessageLoggers do not use trace event classes. This method is a no operation.
addTraceEventClass
in class RASMaskChangeGenerator
name
- The event class name. Input is ignored.public void removeTraceEventClass(java.lang.String name)
By definition, MessageLoggers do not use trace event classes. This method is a no operation.
removeTraceEventClass
in class RASMaskChangeGenerator
name
- The event class name. Input is ignored.public void setLogging(boolean flag)
setLogging
in interface com.ibm.CORBA.iiop.OrbMsgLogger
setLogging
in class RASLogger
flag
- a boolean, true to indicate logging is enabled.public void addHandler(RASIHandler handler)
More than one handler may be associated with a logger to direct the message events to multiple destinations.
addHandler
in class RASLogger
handler
- A RAS handler. If the handler is null or is already
registered, this method does nothing.public void removeHandler(RASIHandler handler)
This method is only enabled on the IT-QOS package.
removeHandler
in class RASLogger
handler
- A RAS handler. If the handler is null or is not
registered, this method does nothing.public boolean isSynchronous()
isSynchronous
in class RASLogger
public void setSynchronous(boolean flag)
When logging synchronously, the logger will wait for the handlers to write a log entry before returning to the caller. Otherwise, the log entry is passed to the handler and the logger returns.
By definition, logging in a WebSphere environment is required to be synchronous. Calling this method results in no-operations.
setSynchronous
in class RASLogger
flag
- a boolean. Input is ignored.public void message(long type, java.lang.Object obj, java.lang.String methodName, java.lang.String key)
message
in interface com.ibm.CORBA.iiop.OrbMsgLogger
message
in class RASMessageLogger
type
- The type of the message.obj
- The logging object ("this").methodName
- The name of the logging method.key
- The message key.public void message(long type, java.lang.Object obj, java.lang.String methodName, java.lang.String key, java.lang.Object parm1)
message
in interface com.ibm.CORBA.iiop.OrbMsgLogger
message
in class RASMessageLogger
type
- The type of the message.obj
- The logging object ("this").methodName
- The name of the logging method.key
- The message key.parm1
- An element to be inserted into the message.public void message(long type, java.lang.Object obj, java.lang.String methodName, java.lang.String key, java.lang.Object parm1, java.lang.Object parm2)
message
in interface com.ibm.CORBA.iiop.OrbMsgLogger
message
in class RASMessageLogger
type
- The type of the message.obj
- The logging object ("this").methodName
- The name of the logging method.key
- The message key.parm1
- An element to be inserted into the message.parm2
- An element to be inserted into the message.public void message(long type, java.lang.Object obj, java.lang.String methodName, java.lang.String key, java.lang.Object[] parms)
message
in interface com.ibm.CORBA.iiop.OrbMsgLogger
message
in class RASMessageLogger
type
- The type of the message.obj
- The logging object ("this").methodName
- The name of the logging method.key
- The message key.parms
- An array of elements to be inserted into the message.public void message(long type, java.lang.String className, java.lang.String methodName, java.lang.String key)
message
in interface com.ibm.CORBA.iiop.OrbMsgLogger
message
in class RASMessageLogger
type
- The type of the message.className
- The name of the logging class.methodName
- The name of the logging method.key
- The message key.public void message(long type, java.lang.String className, java.lang.String methodName, java.lang.String key, java.lang.Object parm1)
message
in interface com.ibm.CORBA.iiop.OrbMsgLogger
message
in class RASMessageLogger
type
- The type of the message.className
- The name of the logging class.methodName
- The name of the logging method.key
- The message key.parm1
- An element to be inserted into the message.public void message(long type, java.lang.String className, java.lang.String methodName, java.lang.String key, java.lang.Object parm1, java.lang.Object parm2)
message
in interface com.ibm.CORBA.iiop.OrbMsgLogger
message
in class RASMessageLogger
type
- The type of the message.className
- The name of the logging class.methodName
- The name of the logging method.key
- The message key.parm1
- An element to be inserted into the message.parm2
- An element to be inserted into the message.public void message(long type, java.lang.String className, java.lang.String methodName, java.lang.String key, java.lang.Object[] parms)
message
in interface com.ibm.CORBA.iiop.OrbMsgLogger
message
in class RASMessageLogger
type
- The type of the message.className
- The name of the logging class.methodName
- The name of the logging method.key
- The message key.parms
- An array of elements to be inserted into the message.public void msg(long type, java.lang.Object obj, java.lang.String methodName, java.lang.String key, java.lang.String file)
msg
in interface com.ibm.CORBA.iiop.OrbMsgLogger
msg
in class RASMessageLogger
type
- The type of the message.obj
- The logging object ("this").methodName
- The name of the logging method.key
- The message key.file
- The name of the message file to use.public void msg(long type, java.lang.Object obj, java.lang.String methodName, java.lang.String key, java.lang.String file, java.lang.Object parm1)
msg
in interface com.ibm.CORBA.iiop.OrbMsgLogger
msg
in class RASMessageLogger
type
- The type of the message.obj
- The logging object ("this").methodName
- The name of the logging method.key
- The message key.file
- The name of the message file to use.parm1
- An element to be inserted into the message.public void msg(long type, java.lang.Object obj, java.lang.String methodName, java.lang.String key, java.lang.String file, java.lang.Object parm1, java.lang.Object parm2)
msg
in interface com.ibm.CORBA.iiop.OrbMsgLogger
msg
in class RASMessageLogger
type
- The type of the message.obj
- The logging object ("this").methodName
- The name of the logging method.key
- The message key.file
- The name of the message file to use.parm1
- An element to be inserted into the message.parm2
- An element to be inserted into the message.public void msg(long type, java.lang.Object obj, java.lang.String methodName, java.lang.String key, java.lang.String file, java.lang.Object[] parms)
msg
in interface com.ibm.CORBA.iiop.OrbMsgLogger
msg
in class RASMessageLogger
type
- The type of the message.obj
- The logging object ("this").methodName
- The name of the logging method.key
- The message key.file
- The name of the message file to use.parms
- An array of elements to be inserted into the message.public void msg(long type, java.lang.String className, java.lang.String methodName, java.lang.String key, java.lang.String file)
msg
in interface com.ibm.CORBA.iiop.OrbMsgLogger
msg
in class RASMessageLogger
type
- The type of the message.className
- The name of the logging class.methodName
- The name of the logging method.key
- The message key.file
- The name of the message file to use.public void msg(long type, java.lang.String className, java.lang.String methodName, java.lang.String key, java.lang.String file, java.lang.Object parm1)
msg
in interface com.ibm.CORBA.iiop.OrbMsgLogger
msg
in class RASMessageLogger
type
- The type of the message.className
- The name of the logging class.methodName
- The name of the logging method.key
- The message key.file
- The name of the message file to use.parm1
- An element to be inserted into the message.public void msg(long type, java.lang.String className, java.lang.String methodName, java.lang.String key, java.lang.String file, java.lang.Object parm1, java.lang.Object parm2)
msg
in interface com.ibm.CORBA.iiop.OrbMsgLogger
msg
in class RASMessageLogger
type
- The type of the message.className
- The name of the logging class.methodName
- The name of the logging method.key
- The message key.file
- The name of the message file to use.parm1
- An element to be inserted into the message.parm2
- An element to be inserted into the message.public void msg(long type, java.lang.String className, java.lang.String methodName, java.lang.String key, java.lang.String file, java.lang.Object[] parms)
msg
in interface com.ibm.CORBA.iiop.OrbMsgLogger
msg
in class RASMessageLogger
type
- The type of the message.className
- The name of the logging class.methodName
- The name of the logging method.key
- The message key.file
- The name of the message file to use.parms
- An array of elements to be inserted into the message.public void textMessage(long type, java.lang.Object obj, java.lang.String methodName, java.lang.String text)
textMessage
in interface com.ibm.CORBA.iiop.OrbMsgLogger
textMessage
in class RASMessageLogger
type
- The type of the message.obj
- The logging object ("this").methodName
- The name of the logging method.text
- The message text.public void textMessage(long type, java.lang.Object obj, java.lang.String methodName, java.lang.String text, java.lang.Object parm1)
textMessage
in interface com.ibm.CORBA.iiop.OrbMsgLogger
textMessage
in class RASMessageLogger
type
- The type of the message.obj
- The logging object ("this").methodName
- The name of the logging method.text
- The message text.parm1
- An element to be displayed with the message.public void textMessage(long type, java.lang.Object obj, java.lang.String methodName, java.lang.String text, java.lang.Object parm1, java.lang.Object parm2)
textMessage
in interface com.ibm.CORBA.iiop.OrbMsgLogger
textMessage
in class RASMessageLogger
type
- The type of the message.obj
- The logging object ("this").methodName
- The name of the logging method.text
- The message text.parm1
- An element to be displayed with the message.parm2
- An element to be displayed with the message.public void textMessage(long type, java.lang.Object obj, java.lang.String methodName, java.lang.String text, java.lang.Object[] parms)
textMessage
in interface com.ibm.CORBA.iiop.OrbMsgLogger
textMessage
in class RASMessageLogger
type
- The type of the message.obj
- The logging object ("this").methodName
- The name of the logging method.text
- The message text.parms
- An array of elements to be displayed with the message.public void textMessage(long type, java.lang.String className, java.lang.String methodName, java.lang.String text)
textMessage
in interface com.ibm.CORBA.iiop.OrbMsgLogger
textMessage
in class RASMessageLogger
type
- The type of the message.className
- The name of the logging class.methodName
- The name of the logging method.text
- The message text.public void textMessage(long type, java.lang.String className, java.lang.String methodName, java.lang.String text, java.lang.Object parm1)
textMessage
in interface com.ibm.CORBA.iiop.OrbMsgLogger
textMessage
in class RASMessageLogger
type
- The type of the message.className
- The name of the logging class.methodName
- The name of the logging method.text
- The message text.parm1
- An element to be displayed with the message.public void textMessage(long type, java.lang.String className, java.lang.String methodName, java.lang.String text, java.lang.Object parm1, java.lang.Object parm2)
textMessage
in interface com.ibm.CORBA.iiop.OrbMsgLogger
textMessage
in class RASMessageLogger
type
- The type of the message.className
- The name of the logging class.methodName
- The name of the logging method.text
- The message text.parm1
- An element to be displayed with the message.parm2
- An element to be displayed with the message.public void textMessage(long type, java.lang.String className, java.lang.String methodName, java.lang.String text, java.lang.Object[] parms)
textMessage
in interface com.ibm.CORBA.iiop.OrbMsgLogger
textMessage
in class RASMessageLogger
type
- The type of the message.className
- The name of the logging class.methodName
- The name of the logging method.text
- The message text.parms
- An array of elements to be displayed with the message.public void exception(long type, java.lang.Object obj, java.lang.String methodName, java.lang.Exception exception)
exception
in class RASMessageLogger
type
- The type of the trace point.obj
- The traced object ("this").methodName
- The name of the traced method.exception
- an Exception.public void exception(long type, java.lang.String className, java.lang.String methodName, java.lang.Exception exception)
exception
in class RASMessageLogger
type
- The type of the trace point.className
- The name of the traced class.methodName
- The name of the traced method.exception
- an Exception.public void exception(long type, java.lang.Object obj, java.lang.String methodName, java.lang.Throwable throwable)
exception
in class RASMessageLogger
type
- The type of the trace point.obj
- The traced object ("this").methodName
- The name of the traced method.throwable
- a Throwable.public void exception(long type, java.lang.String className, java.lang.String methodName, java.lang.Throwable throwable)
exception
in class RASMessageLogger
type
- The type of the trace point.className
- The name of the traced class.methodName
- The name of the traced method.throwable
- a Throwable.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |