Syslog: White Paper FAQ Examples JavaDoc
Protomatter Classes v1.1.6

com.protomatter.syslog
Class LengthRolloverLog

java.lang.Object
  |
  +--com.protomatter.syslog.BasicLogger
        |
        +--com.protomatter.syslog.LengthRolloverLog
All Implemented Interfaces:
Syslogger

public class LengthRolloverLog
extends BasicLogger

An implementation of an object that will log things using the Syslog facility, and roll it's log files after a certain number of bytes have been written to them.

See Also:
XML configuration class

Fields inherited from class com.protomatter.syslog.BasicLogger
formatter, policy, realPolicy
 
Constructor Summary
LengthRolloverLog()
          You will need to call the configure() method to configure this logger if you use this constructor.
LengthRolloverLog(java.lang.String basename, java.lang.String extension, int roll, boolean append, boolean autoFlush)
          Write log information to the given log, roll when specified.
 
Method Summary
 void flush()
          Flush the given logger's output.
 boolean getAppend()
          Get the append-to-file flag.
 boolean getAutoFlush()
          Get the auto-flush flag.
 java.lang.String getBasename()
          Get the base file name.
 java.lang.String getExtension()
          Get the file extension.
 int getRollLength()
          Get the max file size (in bytes).
 void log(SyslogMessage message)
          Log an entry to the log.
 void rollover()
          Roll the logs now.
 void setAppend(boolean append)
          Set the append-to-file flag.
 void setAutoFlush(boolean autoFlush)
          Set the auto-flush flag.
 void setBasename(java.lang.String basename)
          Set the base file name.
 void setExtension(java.lang.String extension)
          Set the file extension.
 void setRollLength(int rolllength)
          Set the max file size (in bytes).
 void shutdown()
          Shutdown this logger.
 
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
 

Constructor Detail

LengthRolloverLog

public LengthRolloverLog(java.lang.String basename,
                         java.lang.String extension,
                         int roll,
                         boolean append,
                         boolean autoFlush)
Write log information to the given log, roll when specified. The file written to will actually be "basename.number" where number is from 1..N (1 being older log entries than N) When starting, if logfiles basename.1 through basename.N exist, it will begin writing to basename.N+1. By default, all channels are listened to.

LengthRolloverLog

public LengthRolloverLog()
You will need to call the configure() method to configure this logger if you use this constructor.
Method Detail

setRollLength

public void setRollLength(int rolllength)
Set the max file size (in bytes). Default is 1MB.

getRollLength

public int getRollLength()
Get the max file size (in bytes).

setBasename

public void setBasename(java.lang.String basename)
Set the base file name.

getBasename

public java.lang.String getBasename()
Get the base file name.

setExtension

public void setExtension(java.lang.String extension)
Set the file extension.

getExtension

public java.lang.String getExtension()
Get the file extension.

setAppend

public void setAppend(boolean append)
Set the append-to-file flag. Default is true.

getAppend

public boolean getAppend()
Get the append-to-file flag.

setAutoFlush

public void setAutoFlush(boolean autoFlush)
Set the auto-flush flag. Default is false.

getAutoFlush

public boolean getAutoFlush()
Get the auto-flush flag.

rollover

public void rollover()
Roll the logs now.

log

public final void log(SyslogMessage message)
Description copied from interface: Syslogger
Log an entry to the log.

flush

public void flush()
Description copied from interface: Syslogger
Flush the given logger's output.

shutdown

public void shutdown()
Description copied from interface: Syslogger
Shutdown this logger. The implementation should clean up any resources it has allocated, etc. After this method is called, no more log messages will be sent to this logger.

Protomatter Classes v1.1.6
Copyright 1998-2001 Nate Sammons

Protomatter Classes v1.1.6 http://protomatter.sourceforge.net/1.1.6