com.protomatter.syslog
Class PrintWriterLog
java.lang.Object
|
+--com.protomatter.syslog.BasicLogger
|
+--com.protomatter.syslog.PrintWriterLog
- All Implemented Interfaces:
- Syslogger
- public class PrintWriterLog
- extends BasicLogger
An implementation of an object that will log things
using the Syslog facility.
- See Also:
XML configuration class
Constructor Summary |
PrintWriterLog()
Construct a new PrintWriterLog -- you must call
configure() after using this constructor. |
PrintWriterLog(java.io.PrintWriter writer)
Construct a new PrintWriterLog attached to the given
PrintWriter. |
PrintWriterLog(java.lang.String streamName)
Construct a new PrintWriterLog attached to the given
stream. |
Method Summary |
void |
flush()
Flush the given logger's output. |
java.lang.String |
getStreamName()
Get the name of the stream. |
void |
log(SyslogMessage message)
Write a log message. |
void |
setStreamName(java.lang.String streamName)
Set the name of the stream. |
void |
setWriter(java.io.PrintWriter writer)
Set the writer that we're writing to. |
void |
shutdown()
Clean up and prepare for shutdown. |
Methods inherited from class com.protomatter.syslog.BasicLogger |
formatLogEntry, getName, getPolicy, getTextFormatter, isSuspended, mightLog, resetDateFormat, resume, setName, setPolicy, setTextFormatter, shouldLog, suspend |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PrintWriterLog
public PrintWriterLog(java.io.PrintWriter writer)
- Construct a new PrintWriterLog attached to the given
PrintWriter. By default, it will respond to log entries
coming along on all channels.
PrintWriterLog
public PrintWriterLog(java.lang.String streamName)
- Construct a new PrintWriterLog attached to the given
stream. The stream name must be either
"System.out" or "System.err".
PrintWriterLog
public PrintWriterLog()
- Construct a new PrintWriterLog -- you must call
configure() after using this constructor.
getStreamName
public java.lang.String getStreamName()
- Get the name of the stream.
setStreamName
public void setStreamName(java.lang.String streamName)
- Set the name of the stream.
setWriter
public void setWriter(java.io.PrintWriter writer)
- Set the writer that we're writing to.
log
public void log(SyslogMessage message)
- Write a log message.
shutdown
public void shutdown()
- Clean up and prepare for shutdown.
flush
public void flush()
- Description copied from interface:
Syslogger
- Flush the given logger's output.