Build 1.0_r1(from source)

java.util.logging
Class XMLFormatter

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

public class XMLFormatter
extends Formatter

Format a given LogRecord into string represents XML. The DTD specified in Appendix A to Java Logging APIs specification is used. XMLFormatter uses given Handler's encoding if has, otherwise uses default platform encoding instead. However, the UTF-8 is recommended encoding.


Constructor Summary
XMLFormatter()
          Default constructor
 
Method Summary
 String format(LogRecord r)
          Format a LogRecord into string which represents XML
 String getHead(Handler h)
          Return the header string for XML, use given handler's encoding if has, other wise use default platform encoding
 String getTail(Handler h)
          Return the tail string for XML
 
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

XMLFormatter

public XMLFormatter()
Default constructor

Method Detail

format

public String format(LogRecord r)
Format a LogRecord into string which represents XML

Specified by:
format in class Formatter
Parameters:
r - the given LogRecord instance to be formatted
Returns:
string which represents XML

getHead

public String getHead(Handler h)
Return the header string for XML, use given handler's encoding if has, other wise use default platform encoding

Overrides:
getHead in class Formatter
Parameters:
h - the given handler
Returns:
the header string for XML

getTail

public String getTail(Handler h)
Return the tail string for XML

Overrides:
getTail in class Formatter
Parameters:
h - the given handler
Returns:
the tail string for XML

Build 1.0_r1(from source)

Please submit a feedback, bug or feature