public class

XMLFormatter

extends Formatter
java.lang.Object
   ↳ java.util.logging.Formatter
     ↳ java.util.logging.XMLFormatter

Class Overview

Formatter to convert a LogRecord into an XML string. The DTD specified in Appendix A to the Java Logging APIs specification is used. XMLFormatter uses the output handler's encoding if it is specified, otherwise the default platform encoding is used instead. UTF-8 is the recommended encoding.

Summary

Public Constructors
XMLFormatter()
Constructs a new XMLFormatter.
Public Methods
String format(LogRecord r)
Converts a LogRecord into an XML string.
String getHead(Handler h)
Returns the header string for a set of log records formatted as XML strings, using the output handler's encoding if it is defined, otherwise using the default platform encoding.
String getTail(Handler h)
Returns the tail string for a set of log records formatted as XML strings.
[Expand]
Inherited Methods
From class java.util.logging.Formatter
From class java.lang.Object

Public Constructors

public XMLFormatter ()

Since: API Level 1

Constructs a new XMLFormatter.

Public Methods

public String format (LogRecord r)

Since: API Level 1

Converts a LogRecord into an XML string.

Parameters
r the log record to be formatted.
Returns
  • the log record formatted as an XML string.

public String getHead (Handler h)

Since: API Level 1

Returns the header string for a set of log records formatted as XML strings, using the output handler's encoding if it is defined, otherwise using the default platform encoding.

Parameters
h the output handler, may be null.
Returns
  • the header string for log records formatted as XML strings.

public String getTail (Handler h)

Since: API Level 1

Returns the tail string for a set of log records formatted as XML strings.

Parameters
h the output handler, may be null.
Returns
  • the tail string for log records formatted as XML strings.