org.clapper.util.logging
Class JavaUtilLoggingTextFormatter

java.lang.Object
  extended by java.util.logging.Formatter
      extended by org.clapper.util.logging.JavaUtilLoggingTextFormatter

public class JavaUtilLoggingTextFormatter
extends java.util.logging.Formatter

Implements a log formatter for the java.util.logging infrastructure that formats each non-exception log record as a simple, single-line text string. (Exception stack traces will cause a message to consume multiple lines.) This formatter currently cannot be configured in any way, though that may change in subsequent releases. The output format is similar to Log4J's PatternLayout class, with a format of "%d %-5p (%c{1}): %m%n".

Version:
$Revision: 6735 $
Author:
Copyright © 2004-2007 Brian M. Clapper

Constructor Summary
JavaUtilLoggingTextFormatter()
          Create a new JavaUtilLoggingTextLogFormatter.
 
Method Summary
 java.lang.String format(java.util.logging.LogRecord record)
          Format the given log record and return the formatted string.
 
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
 

Constructor Detail

JavaUtilLoggingTextFormatter

public JavaUtilLoggingTextFormatter()
Create a new JavaUtilLoggingTextLogFormatter.

Method Detail

format

public java.lang.String format(java.util.logging.LogRecord record)

Format the given log record and return the formatted string.

The resulting formatted String will normally include a localized and formated version of the LogRecord's message field.

Specified by:
format in class java.util.logging.Formatter
Parameters:
record - the log record to be formatted
Returns:
the formatted log record


Copyright © 2004-2007 Brian M. Clapper. All Rights Reserved.