public class FileAppender<E> extends OutputStreamAppender<E>
Type | Property and Description |
---|---|
java.lang.String |
rawFile
This method is used by derived classes to obtain the raw file property.
|
Modifier and Type | Field and Description |
---|---|
static long |
DEFAULT_BUFFER_SIZE |
Constructor and Description |
---|
FileAppender() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFile()
Returns the value of the File property.
|
boolean |
isAppend()
Returns the value of the Append property.
|
boolean |
isPrudent() |
void |
openFile(java.lang.String file_name)
Sets and opens the file where the log output will go.
|
java.lang.String |
rawFileProperty()
This method is used by derived classes to obtain the raw file property.
|
void |
setAppend(boolean append) |
void |
setBufferSize(FileSize bufferSize) |
void |
setFile(java.lang.String file)
The File property takes a string value which should be the name of
the file to append to.
|
void |
setPrudent(boolean prudent)
When prudent is set to true, file appenders from multiple JVMs can safely
write to the same file.
|
void |
start()
If the value of File is not
null , then
openFile(java.lang.String) is called with the values of File and
Append properties. |
void |
stop()
Stop this appender instance.
|
getEncoder, getOutputStream, isImmediateFlush, setEncoder, setImmediateFlush, setLayout, setOutputStream
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toString
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getStatusManager, setContext
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
public final java.lang.String rawFileProperty
public static final long DEFAULT_BUFFER_SIZE
public void setFile(java.lang.String file)
public boolean isAppend()
public final java.lang.String rawFileProperty()
public java.lang.String getFile()
This method may be overridden by derived classes.
public void start()
null
, then
openFile(java.lang.String)
is called with the values of File and
Append properties.start
in interface LifeCycle
start
in class OutputStreamAppender<E>
public void stop()
OutputStreamAppender
Stopped appenders cannot be reused.
stop
in interface LifeCycle
stop
in class OutputStreamAppender<E>
public void openFile(java.lang.String file_name) throws java.io.IOException
Sets and opens the file where the log output will go. The specified file must be writable.
If there was already an opened file, then the previous file is closed first.
Do not use this method directly. To configure a FileAppender or one of its subclasses, set its properties one by one and then call start().
file_name
- The path to the log file.java.io.IOException
public boolean isPrudent()
setPrudent(boolean)
public void setPrudent(boolean prudent)
prudent
- public void setAppend(boolean append)
public void setBufferSize(FileSize bufferSize)
Copyright © 2010 - 2020 Adobe. All Rights Reserved