Package java.util.logging
Class XMLFormatter
java.lang.Object
java.util.logging.Formatter
java.util.logging.XMLFormatter
public class XMLFormatter extends Formatter
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.-
Constructor Summary
Constructors Constructor Description XMLFormatter()Constructs a newXMLFormatter. -
Method Summary
Modifier and Type Method Description Stringformat(LogRecord r)Converts aLogRecordinto an XML string.StringgetHead(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.StringgetTail(Handler h)Returns the tail string for a set of log records formatted as XML strings.Methods inherited from class java.util.logging.Formatter
formatMessage
-
Constructor Details
-
XMLFormatter
public XMLFormatter()Constructs a newXMLFormatter.
-
-
Method Details
-
format
Converts aLogRecordinto an XML string. -
getHead
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. -
getTail
Returns the tail string for a set of log records formatted as XML strings.
-