org.apache.log.output.io
public class FileTarget extends StreamTarget
Modifier and Type | Field and Description |
---|---|
private boolean |
m_append |
private File |
m_file |
Constructor and Description |
---|
FileTarget(File file,
boolean append,
Formatter formatter)
Construct file target to write to a file with a formatter.
|
Modifier and Type | Method and Description |
---|---|
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.
|
close, setOutputStream, shutdownStream, write
doProcessEvent, getFormatter, open
getErrorHandler, isOpen, processEvent, setErrorHandler
private File m_file
private boolean m_append
public FileTarget(File file, boolean append, Formatter formatter) throws IOException
file
- the file to write toappend
- true if file is to be appended to, false otherwiseformatter
- the FormatterIOException
- if an error occursprotected void setFile(File file, boolean append) throws IOException
file
- the file to write toappend
- true if file is to be appended to, false otherwiseIOException
- if directories can not be created or file can not be openedprotected void openFile() throws IOException
IOException
- if directories can not be created or file can not be openedprotected File getFile()
Copyright © 2003-2004 The Apache Software Foundation. All Rights Reserved.