| org.apache.log.output.io.StreamTarget org.apache.log.output.io.FileTarget
All known Subclasses: org.apache.log.output.io.rotate.RotatingFileTarget, org.apache.log.output.io.SafeFileTarget,
Constructor Summary | |
public | FileTarget(File file, boolean append, Formatter formatter) Construct file target to write to a file with a formatter. |
Method Summary | |
protected synchronized File | getFile() Retrieve file associated with target. | protected synchronized void | openFile() Open underlying file and allocate resources. | protected synchronized void | setFile(File file, boolean append) Set the file for this target. |
FileTarget | public FileTarget(File file, boolean append, Formatter formatter) throws IOException(Code) | | Construct file target to write to a file with a formatter.
Parameters: file - the file to write to Parameters: append - true if file is to be appended to, false otherwise Parameters: formatter - the Formatter exception: IOException - if an error occurs |
getFile | protected synchronized File getFile()(Code) | | Retrieve file associated with target.
This allows subclasses to access file object.
the output File |
openFile | protected synchronized void openFile() throws IOException(Code) | | Open underlying file and allocate resources.
This method will attempt to create directories below file and
append to it if specified.
exception: IOException - if directories can not be created or file can not be opened |
setFile | protected synchronized void setFile(File file, boolean append) throws IOException(Code) | | Set the file for this target.
Parameters: file - the file to write to Parameters: append - true if file is to be appended to, false otherwise exception: IOException - if directories can not be created or file can not be opened |
|
|