Overview | Package | Class | Use | Tree | Deprecated | Index | Help
|  | BEA Systems, Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## BEA WebLogic Server 9.0 API Reference

## weblogic.logging
Class ConsoleFormatter

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

All Implemented Interfaces:
  weblogic.logging.LogEntryFormatter

Direct Known Subclasses:
  LogFileFormatter

public class ConsoleFormatter
extends Formatter
implements weblogic.logging.LogEntryFormatter

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`

  Copyright © 2005 BEA Systems, Inc. All Rights Reserved.

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

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

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(weblogic.logging.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 LogMBean parameter

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

### ConsoleFormatter

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

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

Method Detail

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

### appendToBuffer

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

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

### appendToBufferEscaped

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

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

### format

    public String format(LogRecord rec)

  Formats a WLLogRecord object into a String representation.

  Parameters:
    `rec` - The log record that needs to be formatted.
  Returns:
    The formatted string that will be written to stdout.

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

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

### toString

    public String toString(weblogic.logging.LogEntry logEntry)

  Formats a log entry object to a string representation.

  Specified by:
    `toString` in interface `weblogic.logging.LogEntryFormatter`
  Parameters:
    `logEntry` -
  Returns:

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Documentation is available at http://e-docs.bea.com/wls/docs90 Copyright 2005 BEA Systems Inc.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD