com.antelmann.util.logging
Class XMLLogWriter
java.lang.Object
com.antelmann.util.logging.AbstractLogWriter<String>
com.antelmann.util.logging.XMLLogWriter
- All Implemented Interfaces:
- Filter<LogEntry>, LogWriter, Closeable
- Direct Known Subclasses:
- EmailWriter
public class XMLLogWriter
- extends AbstractLogWriter<String>
- implements Closeable
writes LogEntry objects formatted as XML to either a PrintStream or PrintWriter.
As the XMLLogWriter uses a PrintStream/PrintWriter to write the log entries,
no exception is thrown during logging. You'll have to check
the PrintStream/PrintWriter object to check for errors.
- Author:
- Holger Antelmann
- See Also:
XMLLogFormatter
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
XMLLogWriter
public XMLLogWriter(PrintStream ps)
XMLLogWriter
public XMLLogWriter(PrintWriter pw)
getPrintStream
public PrintStream getPrintStream()
getPrintWriter
public PrintWriter getPrintWriter()
flush
public void flush()
- only needed if
getAlwaysFlush() returns false
setAlwaysFlush
public void setAlwaysFlush(boolean flag)
getAlwaysFlush
public boolean getAlwaysFlush()
- true by default
writeLogPattern
public void writeLogPattern(String pattern)
- Description copied from class:
AbstractLogWriter
- writes the pattern to the log entity.
If the LogEntryFormatter is null, the pattern is the LogEntry object
itself; otherwise, the pattern is the result of formatting the LogEntry
with the given LogEntryFormatter.
- Specified by:
writeLogPattern in class AbstractLogWriter<String>
close
public void close()
- Specified by:
close in interface Closeable
(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads