Skip to content

Most visited

Recently visited

navigation
Added in API level 1

XMLFormatter

public class XMLFormatter
extends Formatter

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


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.

Inherited methods

From class java.util.logging.Formatter
From class java.lang.Object

Public constructors

XMLFormatter

Added in API level 1
XMLFormatter ()

Constructs a new XMLFormatter.

Public methods

format

Added in API level 1
String format (LogRecord r)

Converts a LogRecord into an XML string.

Parameters
r LogRecord: the log record to be formatted.
Returns
String the log record formatted as an XML string.

getHead

Added in API level 1
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.

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

getTail

Added in API level 1
String getTail (Handler h)

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

Parameters
h Handler: the output handler, may be null.
Returns
String the tail string for log records formatted as XML strings.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.