dsto.dfc.logging
Class FileLogger

java.lang.Object
  extended by dsto.dfc.logging.FileLogger
All Implemented Interfaces:
LogListener, EventListener

public class FileLogger
extends Object
implements LogListener

Prints selected log events to a file.

Author:
mpp

Constructor Summary
FileLogger(File path)
           
FileLogger(String path)
           
 
Method Summary
 void dispose()
           
 void messageReceived(LogEvent e)
           
 void print(String message)
           
 void print(Throwable exception)
           
static File rollover(File logFile, int rolloverMax)
          Rolls over the supplied logFile using the convention logFilename -> logFilename.1, logFilename.1 -> logFilename.2 TODO Should to make this an 'automatic' feature of FileLogger
 void setEnabled(int type, boolean enabled)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileLogger

public FileLogger(String path)

FileLogger

public FileLogger(File path)
Method Detail

dispose

public void dispose()

messageReceived

public void messageReceived(LogEvent e)
Specified by:
messageReceived in interface LogListener

print

public void print(String message)

print

public void print(Throwable exception)

setEnabled

public void setEnabled(int type,
                       boolean enabled)

rollover

public static File rollover(File logFile,
                            int rolloverMax)
Rolls over the supplied logFile using the convention logFilename -> logFilename.1, logFilename.1 -> logFilename.2 TODO Should to make this an 'automatic' feature of FileLogger

Parameters:
logFile - The logFile to rollover
rolloverMax - The maximum number of rolled over log files, log files exceeding this number will be deleted
Returns:
Returns a reference to the new, empty rolled over log file


Copyright © 2008 Commonwealth of Australia