java.lang.Objectorg.apache.log4j.AppenderSkeleton
org.apache.log4j.WriterAppender
All Implemented Interfaces:
OptionHandler, Appender
Direct Known Subclasses:
ConsoleAppender, ExternallyRolledFileAppender, DailyRollingFileAppender, RollingFileAppender, DailyFileAppender, FileAppender, CompositeRollingAppender
Ceki - Gülcü1.1 - | Field Summary | ||
|---|---|---|
| protected boolean | immediateFlush | Immediate flush means that the underlying writer or output stream
will be flushed at the end of each append operation. Immediate
flush is slower but ensures that each append request is actually
written. If immediateFlush is set to
false, then there is a good chance that the last few
logs events are not actually written to persistent media if and
when the application crashes.
The |
| protected String | encoding | The encoding to use when writing. The
|
| protected QuietWriter | qw | This is the quietWriter where we will write to. |
| Fields inherited from org.apache.log4j.AppenderSkeleton: |
|---|
| layout, name, threshold, errorHandler, headFilter, tailFilter, closed |
| Constructor: |
|---|
|
os
as its OutputStream . |
writer.
The |
| Method from org.apache.log4j.WriterAppender Summary: |
|---|
| activateOptions, append, checkEntryConditions, close, closeWriter, createWriter, getEncoding, getImmediateFlush, requiresLayout, reset, setEncoding, setErrorHandler, setImmediateFlush, setWriter, subAppend, writeFooter, writeHeader |
| Methods from org.apache.log4j.AppenderSkeleton: |
|---|
| activateOptions, addFilter, append, clearFilters, doAppend, finalize, getErrorHandler, getFilter, getFirstFilter, getLayout, getName, getThreshold, isAsSevereAsThreshold, setErrorHandler, setLayout, setName, setThreshold |
| Methods from java.lang.Object: |
|---|
| equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method from org.apache.log4j.WriterAppender Detail: |
|---|
|
If the output stream exists and is writable then write a log
statement to the output stream. Otherwise, write a single warning
message to The format of the output will depend on this appender's layout. |
It checks whether there is a set output target and also if
there is a set layout. If these checks fail, then the boolean
value |
Closed appenders cannot be reused. |
|
encoding property. If the encoding value is
specified incorrectly the writer will be opened using the default
system encoding (an error message will be printed to the loglog. |
|
|
true. |
|
|
|
true, the appender will flush at the end of each
write. This is the default behavior. If the option is set to
false, then the underlying stream can defer writing
to physical medium to a later time.
Avoiding the flush operation at the end of each append results in a performance gain of 10 to 20 percent. However, there is safety tradeoff involved in skipping flushing. Indeed, when flushing is skipped, then it is likely that the last few log events will not be recorded on disk when the application exits. This is a high price to pay even for a 20% performance gain. |
Sets the Writer where the log output will go. The specified Writer must be opened by the user and be writable. The WARNING: Logging to an unopened Writer will fail. |
Most subclasses of |
|
|