Oracle Fusion Middleware
Java API Reference for Oracle PDK Java

11g Release 1 (11.1.1)

E10691-01


oracle.portal.log
Class MessageContext

java.lang.Object
  extended by 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

[&ltname1&gt=&ltvalue1&gt, &ltname2&gt=&ltvalue2&gt...]


Constructor Summary
MessageContext(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(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

Oracle Fusion Middleware
Java API Reference for Oracle PDK Java

11g Release 1 (11.1.1)

E10691-01


Copyright (c) 1999, 2009, Oracle and/or its affiliates. All rights reserved.