org.apache.log.output.io

Class SafeFileTarget

public class SafeFileTarget extends FileTarget

A target that will open and close a file for each logevent. This is slow but a more reliable form of logging on some filesystems/OSes. It should only be used when there is a small number of log events.

Author: Peter Donald

Constructor Summary
SafeFileTarget(File file, boolean append, Formatter formatter)
Construct file target to write to a file with a formatter.
Method Summary
voidprocessEvent(LogEvent event)
Process a log event, via formatting and outputting it.

Constructor Detail

SafeFileTarget

public SafeFileTarget(File file, boolean append, Formatter formatter)
Construct file target to write to a file with a formatter.

Parameters: file the file to write to append true if file is to be appended to, false otherwise formatter the Formatter

Throws: IOException if an error occurs

Method Detail

processEvent

public void processEvent(LogEvent event)
Process a log event, via formatting and outputting it.

Parameters: event the log event