org.productivity.java.syslog4j.impl.backlog.printstream
Class PrintStreamSyslogBackLogHandler

java.lang.Object
  extended by org.productivity.java.syslog4j.impl.backlog.AbstractSyslogBackLogHandler
      extended by org.productivity.java.syslog4j.impl.backlog.printstream.PrintStreamSyslogBackLogHandler
All Implemented Interfaces:
SyslogBackLogHandlerIF
Direct Known Subclasses:
SystemErrSyslogBackLogHandler, SystemOutSyslogBackLogHandler

public class PrintStreamSyslogBackLogHandler
extends AbstractSyslogBackLogHandler

PrintStreamSyslogBackLogHandler provides a last-chance mechanism to log messages that fail (for whatever reason) within the rest of Syslog to a PrintStream.

Syslog4j is licensed under the Lesser GNU Public License v2.1. A copy of the LGPL license is available in the META-INF folder in all distributions of Syslog4j and in the base directory of the "doc" ZIP.

Version:
$Id: PrintStreamSyslogBackLogHandler.java,v 1.1 2009/01/24 22:00:18 cvs Exp $
Author:
<syslog4j@productivity.org>

Field Summary
protected  boolean appendLinefeed
           
protected  java.io.PrintStream printStream
           
 
Fields inherited from class org.productivity.java.syslog4j.impl.backlog.AbstractSyslogBackLogHandler
appendReason
 
Constructor Summary
PrintStreamSyslogBackLogHandler(java.io.PrintStream printStream)
           
PrintStreamSyslogBackLogHandler(java.io.PrintStream printStream, boolean appendLinefeed)
           
PrintStreamSyslogBackLogHandler(java.io.PrintStream printStream, boolean appendLinefeed, boolean appendReason)
           
 
Method Summary
 void down(SyslogIF syslog, java.lang.String reason)
          Implement down(syslog,reason) to notify/log when the syslog protocol is unavailable.
 void initialize()
          Implement initialize() to handle one-time set-up for this backLog handler.
 void log(SyslogIF syslog, int level, java.lang.String message, java.lang.String reason)
           
 void up(SyslogIF syslog)
          Implement up(syslog) to notify/log when the syslog protocol becomes available after a down condition.
 
Methods inherited from class org.productivity.java.syslog4j.impl.backlog.AbstractSyslogBackLogHandler
combine
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

printStream

protected java.io.PrintStream printStream

appendLinefeed

protected boolean appendLinefeed
Constructor Detail

PrintStreamSyslogBackLogHandler

public PrintStreamSyslogBackLogHandler(java.io.PrintStream printStream)

PrintStreamSyslogBackLogHandler

public PrintStreamSyslogBackLogHandler(java.io.PrintStream printStream,
                                       boolean appendLinefeed)

PrintStreamSyslogBackLogHandler

public PrintStreamSyslogBackLogHandler(java.io.PrintStream printStream,
                                       boolean appendLinefeed,
                                       boolean appendReason)
Method Detail

initialize

public void initialize()
                throws SyslogRuntimeException
Description copied from interface: SyslogBackLogHandlerIF
Implement initialize() to handle one-time set-up for this backLog handler.

Throws:
SyslogRuntimeException

down

public void down(SyslogIF syslog,
                 java.lang.String reason)
Description copied from interface: SyslogBackLogHandlerIF
Implement down(syslog,reason) to notify/log when the syslog protocol is unavailable.

Parameters:
syslog - - SyslogIF instance causing this down condition
reason - - reason given for the down condition

up

public void up(SyslogIF syslog)
Description copied from interface: SyslogBackLogHandlerIF
Implement up(syslog) to notify/log when the syslog protocol becomes available after a down condition.

Parameters:
syslog - - SyslogIF instance which is now available

log

public void log(SyslogIF syslog,
                int level,
                java.lang.String message,
                java.lang.String reason)
Parameters:
syslog - - SyslogIF instance which cannot handle this log event
level - - message level
message - - message (in String form)
reason - - reason given for why this message could not be handled