|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectjava.util.logging.Formatter
fedora.logging.SimpleXMLFormatter
Description: Formater to turn a LogRecord into a simple XML format.
This differs from XMLFormatter in that it doesn't
save information about sequence, logger, class, or method,
and the time of the error is given only in milliseconds since the epoch.
It also uses the name of the log level instead of a record element,
and (if desired) will parse the messages if they start with [...], and use
the inner text as a 'mid', or message id, and the remaining text for the
text of the message (until non-whitespace after ]). SimpleXMLFormatter
does not handle keys and params for resource bundles -- when using this
class, you buy into the strategy of pre-localizing your messages, and
providing a key in the message itself (before the ']' character), if wanted.
XMLFormatter, this can be used with arbitrary character
encodings.
-----------------------------------------------------------------------------
License and Copyright: The contents of this file are subject to the Mozilla Public License Version 1.1 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.mozilla.org/MPL/.
Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.
The entire file consists of original code. Copyright © 2002-2005 by The Rector and Visitors of the University of Virginia and Cornell University. All rights reserved.
-----------------------------------------------------------------------------
| Constructor Summary | |
SimpleXMLFormatter(boolean logMids,
java.lang.String defaultEncoding)
Constructs a SimpleXMLFormatter. |
|
| Method Summary | |
java.lang.String |
format(java.util.logging.LogRecord record)
Gets a formatted String for the given LogRecord. |
java.lang.String |
getHead(java.util.logging.Handler h)
Gets the header string for a set of XML formatted records. |
java.lang.String |
getTail(java.util.logging.Handler h)
Gets the tail string for a set of XML formatted records. |
| 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 |
public SimpleXMLFormatter(boolean logMids,
java.lang.String defaultEncoding)
SimpleXMLFormatter.
logMids - Whether or not to log message ids.defaultEncoding - The default encoding string to use for the XML
if the handler doesn't define one.| Method Detail |
public java.lang.String format(java.util.logging.LogRecord record)
String for the given LogRecord.
record - The record to be formatted.
public java.lang.String getHead(java.util.logging.Handler h)
h - The target handler.
public java.lang.String getTail(java.util.logging.Handler h)
h - The target handler.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||