com.antelmann.util.logging
Class FileLog
java.lang.Object
com.antelmann.util.logging.AbstractLogWriter<String>
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
|
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)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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)
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