java.util.logging

Class XMLFormatter

public class XMLFormatter extends Formatter

An XMLFormatter formats LogRecords into a standard XML format.
Constructor Summary
XMLFormatter()
Constructs a new XMLFormatter.
Method Summary
Stringformat(LogRecord record)
StringgetHead(Handler h)
Returns a string that handlers are supposed to emit before the first log record.
StringgetTail(Handler h)

Constructor Detail

XMLFormatter

public XMLFormatter()
Constructs a new XMLFormatter.

Method Detail

format

public String format(LogRecord record)

getHead

public String getHead(Handler h)
Returns a string that handlers are supposed to emit before the first log record. The base implementation returns an empty string, but subclasses such as {@link XMLFormatter} override this method in order to provide a suitable header.

Parameters: h the handler which will prepend the returned string in front of the first log record. This method will inspect certain properties of the handler, for example its encoding, in order to construct the header.

Returns: a string for the header.

getTail

public String getTail(Handler h)