|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.log.output.AbstractTarget
org.apache.log.output.AbstractOutputTarget
org.apache.log.output.io.StreamTarget
org.apache.log.output.io.FileTarget
org.apache.log.output.io.SafeFileTarget
public class SafeFileTarget
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.
Field Summary |
---|
Fields inherited from class org.apache.log.output.AbstractOutputTarget |
---|
m_formatter |
Constructor Summary | |
---|---|
SafeFileTarget(java.io.File file,
boolean append,
Formatter formatter)
Construct file target to write to a file with a formatter. |
Method Summary | |
---|---|
void |
processEvent(LogEvent event)
Process a log event, via formatting and outputting it. |
Methods inherited from class org.apache.log.output.io.FileTarget |
---|
getFile, openFile, setFile |
Methods inherited from class org.apache.log.output.io.StreamTarget |
---|
close, setOutputStream, shutdownStream, write |
Methods inherited from class org.apache.log.output.AbstractOutputTarget |
---|
doProcessEvent, getFormatter, open, output, setFormatter |
Methods inherited from class org.apache.log.output.AbstractTarget |
---|
error, getErrorHandler, isOpen, setErrorHandler |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SafeFileTarget(java.io.File file, boolean append, Formatter formatter) throws java.io.IOException
file
- the file to write toappend
- true if file is to be appended to, false otherwiseformatter
- the Formatter
java.io.IOException
- if an error occursMethod Detail |
---|
public void processEvent(LogEvent event)
processEvent
in interface LogTarget
processEvent
in class AbstractTarget
event
- the log event
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |