public class XMLFormatter extends Formatter
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.Constructor and Description |
---|
XMLFormatter()
Constructs a new
XMLFormatter . |
Modifier and Type | Method and Description |
---|---|
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.
|
formatMessage
public String getHead(Handler h)