|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.logging.Handler
org.x4juli.global.components.AbstractHandler
org.x4juli.handlers.WriterHandler
org.x4juli.handlers.ConsoleHandler
ConsoleAppender appends log events to System.out or
System.err using a layout specified by the user. The default
target is System.out.
| Attribute | Description | Required |
|---|---|---|
| .follow | Sets whether the appender honors reassignments of System.out or System.err made after configuration. | No. Default false. |
| .target | Recognized values are "System.out" and "System.err". Any other value will be ignored. | No. Default value is System.out |
Logging API as a whole was originally done for Apache log4j. Juli is a port of main parts of that to complete the Java Logging APIs. All credits for initial idea, design, implementation, documentation belong to the log4j crew. This file was originally published by Ceki Gülcü, Curt Arnold. Please use exclusively the appropriate mailing lists for questions, remarks and contribution.
| Nested Class Summary | |
private static class |
ConsoleHandler.SystemErrStream
An implementation of OutputStream that redirects to the current System.err. |
private static class |
ConsoleHandler.SystemOutStream
An implementation of OutputStream that redirects to the current System.out. |
| Field Summary | |
private boolean |
follow
Determines if the appender honors reassignments of System.out or System.err made after configuration. |
static java.lang.String |
SYSTEM_ERR
|
static java.lang.String |
SYSTEM_OUT
|
protected java.lang.String |
target
|
| Fields inherited from class org.x4juli.handlers.WriterHandler |
immediateFlush, writer |
| Fields inherited from class org.x4juli.global.components.AbstractHandler |
active, closed, extFormatter, headFilter, manager, name, repository, tailFilter |
| Fields inherited from class java.util.logging.Handler |
|
| Constructor Summary | |
ConsoleHandler()
|
|
ConsoleHandler(java.lang.String handlerName)
|
|
| Method Summary | |
void |
activateOptions()
Activate the options that were previously set with calls to option setters.
This allows to defer activiation of the options until all options have
been set. This is required for components which have related options that
remain ambigous until all are set.
|
protected void |
closeWriter()
Close the underlying Writer. |
void |
configure()
Configure all properties of the object. Subclasses should call super.configure() to ensure proper configuration. |
boolean |
getFollow()
Gets whether the appender honors reassignments of System.out or System.err made after configuration. |
java.lang.String |
getFullQualifiedClassName()
Determine performant the FullQualifiedClassName. Subclasses should overwrite this method. Dynamic determination is not recommended. |
java.lang.String |
getTarget()
Returns the current value of the Target property. |
void |
setFollow(boolean newValue)
Sets whether the appender honors reassignments of System.out or System.err made after configuration. |
void |
setTarget(java.lang.String value)
Sets the value of the Target option. |
| Methods inherited from class org.x4juli.handlers.WriterHandler |
appendLogRecord, checkEntryConditions, close, createWriter, flush, getImmediateFlush, setImmediateFlush, setWriter, subAppend, writeFooter, writeHeader |
| Methods inherited from class org.x4juli.global.components.AbstractHandler |
addFilter, clearFilters, finalize, getFilter, getFormatter, getLogger, getLoggerRepository, getMessageProperties, getName, getNonFloodingLogger, getProperty, getProperty, getProperty, isActive, isClosed, isLoggable, isLoggable, publish, publish, resetErrorCount, setFilter, setFormatter, setName, setObjectStore, toString |
| Methods inherited from class java.util.logging.Handler |
getEncoding, getErrorManager, getLevel, reportError, setEncoding, setErrorManager, setLevel |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.x4juli.global.spi.ExtendedHandler |
getEncoding, getErrorManager, getLevel, setEncoding, setErrorManager, setLevel |
| Field Detail |
public static final java.lang.String SYSTEM_OUT
public static final java.lang.String SYSTEM_ERR
protected java.lang.String target
private boolean follow
| Constructor Detail |
public ConsoleHandler()
public ConsoleHandler(java.lang.String handlerName)
handlerName - | Method Detail |
public void configure()
configure in class WriterHandlerpublic void activateOptions()
This allows to defer activiation of the options until all options have
been set. This is required for components which have related options that
remain ambigous until all are set.
Subclasses have not set active to true, but call super as
last statement!
activateOptions in interface OptionHandleractivateOptions in class WriterHandlerpublic void setTarget(java.lang.String value)
public java.lang.String getTarget()
setTarget(java.lang.String).
public final void setFollow(boolean newValue)
newValue - if true, appender will use value of System.out or
System.err in force at the time when logging events are
appended.public final boolean getFollow()
public java.lang.String getFullQualifiedClassName()
getFullQualifiedClassName in interface ExtendedHandlergetFullQualifiedClassName in class WriterHandlerprotected final void closeWriter()
Writer.
closeWriter in class WriterHandler
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||