Overview | Package | Class | Use | Tree | Deprecated | Index | Help
|  | Oracle
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## weblogic.logging
Class ConsoleFormatter

    java.lang.Object
      java.util.logging.Formatter
          weblogic.logging.ConsoleFormatter

Direct Known Subclasses:
  LogFileFormatter

    public class ConsoleFormatter

extends Formatter

Formats log messages to be displayed on the console. This handler is associated with the ConsoleHandler which logs messages to the Stdout. The log output in the console shows the timestamp, severity, subsystem, id, and the message. The `KernelMBean.StdoutLogStack` controls whether stack traces are included in the logged message. The `KernelMBean.StdoutFormat` attribute controls whether the log id is included in the console logged output. The timestamp format is DateFormat.MEDIUM for the date component and DateFormat.FULL for the time component. The actual output format depends on the default settings for the Locale. This formatter is also used for NonCatalogLoggers on the client side.

See Also:
  `KernelMBean.isStdoutLogStack()`, `KernelMBean.getStdoutFormat()`, `DateFormat`

Field Summary
`static String` | `FIELD_PREFIX`
`static String` | `FIELD_SUFFIX`

Constructor Summary
`ConsoleFormatter()` Default constructor when no LogMBean is present.
`ConsoleFormatter(weblogic.management.configuration.CommonLogMBean logMBean)` Initializes the console formatter with the configuration information in the LogMBean.
`ConsoleFormatter(weblogic.management.configuration.KernelMBean kernelMBean)` Deprecated. Use the constructor with the CommonLogMBean parameter
`ConsoleFormatter(weblogic.management.configuration.LogMBean logMBean)` Deprecated. Use constructor with CommonLogMBean parameter

Method Summary
`protected void` | `appendBuf(StringBuffer buf, String str)` Deprecated. Use the appendToBuffer method instead
`protected static void` | `appendToBuffer(StringBuffer buf, String str)` Appends the string to the buffer, surrounding it with the delimiters.
`protected static void` | `appendToBufferEscaped(StringBuffer buf, String str)` Appends the string to the buffer, surrounding it with the delimiters.
`String` | `format(LogRecord rec)` Formats a WLLogRecord object into a String representation.
`protected String` | `formatDate(Date date)` Deprecated. Use the formatDateObject method instead
`static String` | `formatDateObject(Date date)` Formats a date in the WebLogic Server log format.
`String` | `toString(LogEntry logEntry)` Formats a log entry object to a string representation.

Methods inherited from class java.util.logging.Formatter
`formatMessage, getHead, getTail`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### FIELD_PREFIX

    public static final String FIELD_PREFIX

See Also:
  Constant Field Values

### FIELD_SUFFIX

    public static final String FIELD_SUFFIX

See Also:
  Constant Field Values

Constructor Detail

### ConsoleFormatter

    public ConsoleFormatter()

  Default constructor when no LogMBean is present.

### ConsoleFormatter

    public ConsoleFormatter(weblogic.management.configuration.KernelMBean kernelMBean)

  Deprecated. Use the constructor with the CommonLogMBean parameter

  Initializes the console formatter with the configuration information in the KernelMBean.

  Parameters:
    `kernelMBean` - The KernelMBean reference which specifies some of the formatting options, that control the log output format to stdout.

### ConsoleFormatter

    public ConsoleFormatter(weblogic.management.configuration.LogMBean logMBean)

  Deprecated. Use constructor with CommonLogMBean parameter

  Initializes the console formatter with the configuration information in the LogMBean.

  Parameters:
    `logMBean` - The LogMBean reference which specifies some of the formatting options, that control the log output format to stdout.

### ConsoleFormatter

    public ConsoleFormatter(weblogic.management.configuration.CommonLogMBean logMBean)

  Initializes the console formatter with the configuration information in the LogMBean.

  Parameters:
    `logMBean` - The LogMBean reference which specifies some of the formatting options, that control the log output format to stdout.

Method Detail

### format

    public String format(LogRecord rec)

  Formats a WLLogRecord object into a String representation.

  Specified by:
    `format` in class `Formatter`
  Parameters:
    `rec` - The log record that needs to be formatted.
  Returns:
    The formatted string that will be written to stdout.

### toString

    public String toString(LogEntry logEntry)

  Formats a log entry object to a string representation.

  Parameters:
    `logEntry` -
  Returns:

### formatDateObject

    public static final String formatDateObject(Date date)

  Formats a date in the WebLogic Server log format.

  Parameters:
    `date` - The date to be formatted
  Returns:
    The formatted string for the given date.

### appendToBufferEscaped

    protected static final void appendToBufferEscaped(StringBuffer buf,
                                                      String str)

  Appends the string to the buffer, surrounding it with the delimiters.

### appendToBuffer

    protected static final void appendToBuffer(StringBuffer buf,
                                               String str)

  Appends the string to the buffer, surrounding it with the delimiters.

### formatDate

    protected String formatDate(Date date)

  Deprecated. Use the formatDateObject method instead

  Formats a date to the WebLogic Server log format.

  Parameters:
    `date` -
  Returns:
    String representation of the date in the Weblogic Server log format.

### appendBuf

    protected void appendBuf(StringBuffer buf,
                             String str)

  Deprecated. Use the appendToBuffer method instead

  Appends the string to the buffer, surrounding it with the delimiters.

  Parameters:
    `buf` - The buffer to which the delimited string is to be appended.
    `str` - The str to appended to the buffer with the delimiters.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Documentation is available at http://edocs.bea.com/wls/docs103 Copyright 1996,2008, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD