logging
Class HTMLFormatter

java.lang.Object
  extended by java.util.logging.Formatter
      extended by logging.HTMLFormatter

public class HTMLFormatter
extends java.util.logging.Formatter

The HTMLFormatter class provides a basic html formatter for java.util.Logger objects. This class will produce basic html files of Logged events.


Constructor Summary
HTMLFormatter()
           
 
Method Summary
 java.lang.String format(java.util.logging.LogRecord rec)
          Creates a table row tagged html element given a LogRecord object.
 java.lang.String getExceptionString(java.util.logging.LogRecord rec)
          Creates an exception String that mimics the Java console exception message given the LogRecord object.
 java.lang.String getHead(java.util.logging.Handler h)
          Creates the html file head information.
 java.lang.String getRowTag(java.util.logging.LogRecord rec)
          Depending on log record Level.
 java.lang.String getTail(java.util.logging.Handler h)
          The html file close tag information.
 
Methods inherited from class java.util.logging.Formatter
formatMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HTMLFormatter

public HTMLFormatter()
Method Detail

format

public java.lang.String format(java.util.logging.LogRecord rec)
Creates a table row tagged html element given a LogRecord object.

Specified by:
format in class java.util.logging.Formatter
Parameters:
rec - The LogRecord object to format into an HTML table row element.
Returns:
The HTML formatted table row element of the given LogRecord.

getHead

public java.lang.String getHead(java.util.logging.Handler h)
Creates the html file head information.

Overrides:
getHead in class java.util.logging.Formatter
Parameters:
h - The Logger Handler object.
Returns:
The String containing the required HTML header information.

getTail

public java.lang.String getTail(java.util.logging.Handler h)
The html file close tag information.

Overrides:
getTail in class java.util.logging.Formatter
Parameters:
h - The Logger Handler object.
Returns:
The String containing the required HTML tail information.

getRowTag

public java.lang.String getRowTag(java.util.logging.LogRecord rec)
Depending on log record Level. A row with color will be returned.

Parameters:
rec - The log record to determine row color.
Returns:
The table row tags with a given row color, should the row need a background color.

getExceptionString

public java.lang.String getExceptionString(java.util.logging.LogRecord rec)
Creates an exception String that mimics the Java console exception message given the LogRecord object.

Parameters:
rec - The LogRecord object to extract exception messages from.
Returns:
A String that closely resembles exception messages in the Java console.