org.apache.log.output.io
Class FileTarget
- ErrorAware, LogTarget
A basic target that writes to a File.
FileTarget(File file, boolean append, Formatter formatter) - Construct file target to write to a file with a formatter.
|
protected File | getFile() - Retrieve file associated with target.
|
protected void | openFile() - Open underlying file and allocate resources.
|
protected void | setFile(File file, boolean append) - Set the file for this target.
|
FileTarget
public FileTarget(File file,
boolean append,
Formatter formatter)
throws IOException
Construct file target to write to a file with a formatter.
file
- the file to write toappend
- true if file is to be appended to, false otherwiseformatter
- the Formatter
getFile
protected File getFile()
Retrieve file associated with target.
This allows subclasses to access file object.
openFile
protected void openFile()
throws IOException
Open underlying file and allocate resources.
This method will attempt to create directories below file and
append to it if specified.
setFile
protected void setFile(File file,
boolean append)
throws IOException
Set the file for this target.
file
- the file to write toappend
- true if file is to be appended to, false otherwise