|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.logging.Formatter
org.x4juli.global.components.AbstractFormatter
AbstractFormatter is for ease of development. It must extend
java.util.logging.Formatter and be a Component with the
attributes of a BaseComponent. The code of BaseComponent is copied here
therefor.
| Field Summary | |
private int |
errorCount
|
protected boolean |
ignoresThrowable
Formatter ignores throwables in output or not. |
private ExtendedLogger |
logger
|
protected java.util.logging.LogManager |
manager
LogManager for easy access. |
protected ObjectStore |
repository
Store for this component. |
| Constructor Summary | |
AbstractFormatter()
|
|
| Method Summary | |
abstract java.lang.String |
doFormat(ExtendedLogRecord record)
|
java.lang.String |
format(ExtendedLogRecord record)
Formats the given LogRecord. |
java.lang.String |
format(java.util.logging.LogRecord record)
|
java.lang.String |
formatMessage(ExtendedLogRecord record)
|
protected ExtendedLogger |
getLogger()
Return an instance specific logger to be used by the component itself. |
protected ObjectStore |
getLoggerRepository()
Return the ObjectStore this component is attached to. |
MessageProperties |
getMessageProperties()
Specifiy Properties for the component. |
protected ExtendedLogger |
getNonFloodingLogger()
Frequently called methods in log4j components can invoke this method in order to avoid flooding the output when logging lasting error conditions. |
protected boolean |
getProperty(java.lang.String name,
boolean defaultValue)
Get an property value out of the LogManager by name. |
protected int |
getProperty(java.lang.String name,
int defaultValue)
Get an property value out of the LogManager by name. |
protected java.lang.String |
getProperty(java.lang.String name,
java.lang.String defaultValue)
Get an property value out of the LogManager by name. |
boolean |
ignoresThrowable()
Formatter ignores throwables in output? |
protected void |
resetErrorCount()
Called by derived classes when they deem that the component has recovered from an erroneous state. |
void |
setIgnoresThrowable(boolean ignoresThrowable)
Formatter ignores throwables in output? |
void |
setObjectStore(ObjectStore rep)
Set the owning repository. |
| Methods inherited from class java.util.logging.Formatter |
formatMessage, getHead, getTail |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.x4juli.global.spi.OptionHandler |
activateOptions |
| Methods inherited from interface org.x4juli.global.spi.ExtendedFormatter |
formatMessage, getHead, getTail |
| Field Detail |
protected ObjectStore repository
protected final java.util.logging.LogManager manager
protected boolean ignoresThrowable
private ExtendedLogger logger
private int errorCount
| Constructor Detail |
public AbstractFormatter()
| Method Detail |
public MessageProperties getMessageProperties()
getMessageProperties in interface Componentpublic void setObjectStore(ObjectStore rep)
setObjectStore in interface Componentrep - The repository where the configuration is storedpublic boolean ignoresThrowable()
ignoresThrowable in interface ExtendedFormatterpublic void setIgnoresThrowable(boolean ignoresThrowable)
ignoresThrowable - whether throwables are ignored or not.public final java.lang.String format(java.util.logging.LogRecord record)
format in interface Formatterpublic java.lang.String format(ExtendedLogRecord record)
format in interface ExtendedFormatterrecord - containing the information to generate and beautify Output
Formatter.format(java.util.logging.LogRecord)public abstract java.lang.String doFormat(ExtendedLogRecord record)
Formatter.format(java.util.logging.LogRecord)public java.lang.String formatMessage(ExtendedLogRecord record)
Formatter.formatMessage(java.util.logging.LogRecord)protected void resetErrorCount()
protected ObjectStore getLoggerRepository()
ObjectStore this component is attached to.
protected ExtendedLogger getLogger()
This logger always sends output to an
ConsoleHandler, which outputs to System.err
protected ExtendedLogger getNonFloodingLogger()
protected java.lang.String getProperty(java.lang.String name,
java.lang.String defaultValue)
LogManager by name.
name - of the parameter to be obtaineddefaultValue -
protected int getProperty(java.lang.String name,
int defaultValue)
LogManager by name.
name - of the parameter to be obtaineddefaultValue -
protected boolean getProperty(java.lang.String name,
boolean defaultValue)
LogManager by name.
name - of the parameter to be obtaineddefaultValue -
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||