oracle.portal.log
Class MessageContext
java.lang.Object
|
+--oracle.portal.log.MessageContext
- public class MessageContext
- extends java.lang.Object
MessageContext is a logging utility class that accepts context information
you want included with each log message and formats messages for output.
This class accepts any number of NameValue
objects that represent the context information. The context string is
constructed by appending the context information together in a format
defined by the implementation. The format used by the base implementation is
[<name1>=<value1>, <name2>=<value2>...]
|
Constructor Summary |
MessageContext(oracle.portal.utils.NameValue[] contextEntries)
Constructor. |
|
Method Summary |
java.lang.String |
formatMessage(java.lang.String msg)
Formats a message by adding context information prior to logging. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MessageContext
public MessageContext(oracle.portal.utils.NameValue[] contextEntries)
- Constructor.
MessageContext builds the context string during object initialization to
minimize the amount of work that must be done when formatting a message.
This implementation uses the name and value elements of each
NameValue when constructing the context
message.
- Parameters:
contextEntries - an array of NVPair objects representing the
context information.
formatMessage
public java.lang.String formatMessage(java.lang.String msg)
- Formats a message by adding context information prior to logging.
- Parameters:
msg - the message that needs to be logged- Returns:
- the formatted message
Copyright (c) 2002, Oracle Corporation. All Rights Reserved.