Holger's
Java API

com.antelmann.util.logging
Class FileLog

java.lang.Object
  extended by com.antelmann.util.logging.AbstractLogWriter<String>
      extended by com.antelmann.util.logging.FileLog
All Implemented Interfaces:
Filter<LogEntry>, LogWriter

public class FileLog
extends AbstractLogWriter<String>

writes entries to a file without continuously holding a lock on the file. LogFile uses a DBLineLogFormatter. This implementation is suitable only for occasional (non-performace critical) write operations, while the file can still be accessed through other processes or threads.

Author:
Holger Antelmann
See Also:
DBLineLogFormatter, LogFile

Field Summary
 
Fields inherited from class com.antelmann.util.logging.AbstractLogWriter
filter
 
Constructor Summary
FileLog(File file)
           
FileLog(File file, boolean useDailyPattern)
          if the usedailyPattern parameter is true, messages are stored into a file name that automatically appends yyymmdd from the current date.
 
Method Summary
 MyFile getFile()
           
 boolean usesDailyPattern()
           
 void writeLogPattern(String pattern)
          writes the pattern to the log entity.
 
Methods inherited from class com.antelmann.util.logging.AbstractLogWriter
accept, getLogFilter, getLogFormatter, setLogFilter, setLogFormatter, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileLog

public FileLog(File file)

FileLog

public FileLog(File file,
               boolean useDailyPattern)
if the usedailyPattern parameter is true, messages are stored into a file name that automatically appends yyymmdd from the current date.

Method Detail

writeLogPattern

public void writeLogPattern(String pattern)
                     throws LogException
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>
Throws:
LogException

getFile

public MyFile getFile()

usesDailyPattern

public boolean usesDailyPattern()


(c) 2001-2006 Holger Antelmann - all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads