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. FileLog 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
 
Fields inherited from interface com.antelmann.util.Filter
EXCLUDE_ALL_FILTER, INCLUDE_ALL_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.
FileLog(File file, LogEntryFormatter<String> formatter, boolean useDailyPattern)
           
 
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.


FileLog

public FileLog(File file,
               LogEntryFormatter<String> formatter,
               boolean useDailyPattern)
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) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads