BEA Systems, Inc.

WebLogic Server 8.1 API Reference

weblogic.logging
Class ConsoleFormatter

java.lang.Object
  |
  +--java.util.logging.Formatter
        |
        +--weblogic.logging.ConsoleFormatter
Direct Known Subclasses:
LogFileFormatter

public class ConsoleFormatter
extends java.util.logging.Formatter

Formats log messages to be displayed on 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 setting 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.

Author:
Copyright © 2004 BEA Systems, Inc. All Rights Reserved.
See Also:
KernelMBean.isStdoutLogStack(), KernelMBean.getStdoutFormat(), DateFormat

Field Summary
static java.lang.String FIELD_PREFIX
           
static java.lang.String FIELD_SUFFIX
           
 
Constructor Summary
protected ConsoleFormatter()
          Initialize the date formatter to be used for rendering dates.
  ConsoleFormatter(KernelMBean kmb)
          Initializes the console formatter with the configuration information in the KernelMBean.
 
Method Summary
 java.lang.String format(java.util.logging.LogRecord rec)
          Formats a WLLogRecord object into a String representation.
protected  java.lang.String formatDate(java.util.Date date)
          Formats a date in the WebLogic Server log format
 
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 java.lang.String FIELD_PREFIX

FIELD_SUFFIX

public static java.lang.String FIELD_SUFFIX
Constructor Detail

ConsoleFormatter

protected ConsoleFormatter()
Initialize the date formatter to be used for rendering dates.

ConsoleFormatter

public ConsoleFormatter(KernelMBean kmb)
Initializes the console formatter with the configuration information in the KernelMBean.

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

format

public java.lang.String format(java.util.logging.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.
Overrides:
format in class java.util.logging.Formatter

formatDate

protected final java.lang.String formatDate(java.util.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.

Documentation is available at
http://download.oracle.com/docs/cd/E13222_01/wls/docs81