Overview | Package | Class | Tree | Deprecated | Index | Help
| OracleAS PDK for Java 9.0.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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`

Constructor Detail

### 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 `NameValue` objects representing the context information.

Method Detail

### 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

Overview | Package | Class | Tree | Deprecated | Index | Help
| OracleAS PDK for Java 9.0.4.0.2
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2002,2003 Oracle Corporation. All Rights Reserved.