|
||||||||||
| 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
org.x4juli.formatter.HTMLFormatter
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ü, Steve Mactaggart . Please use exclusively the appropriate mailing lists for questions, remarks and contribution.
| Field Summary | |
private boolean |
chainHandlesThrowable
|
private long |
counter
|
private boolean |
internalCSS
|
private java.lang.String |
pattern
|
private static java.lang.String |
PATTERN_RULE_REGISTRY
Customized pattern conversion rules are stored under this key in the LoggerRepositoryHolder object store. |
private LogRecordPatternConverter[] |
patternConverters
|
private FormattingInfo[] |
patternFields
|
private java.lang.String |
title
|
protected static java.lang.String |
TRACE_PREFIX
Prefix for Stacktraces. |
private java.lang.String |
url2ExternalCSS
|
| Fields inherited from class org.x4juli.global.components.AbstractFormatter |
ignoresThrowable, manager, repository |
| Constructor Summary | |
HTMLFormatter()
Constructs a PatternLayout using the PatternFormatter.DEFAULT_CONVERSION_PATTERN.
|
|
HTMLFormatter(java.lang.String pattern)
Constructs a PatternLayout using the supplied conversion pattern. |
|
| 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. |
(package private) void |
appendThrowableAsHTML(java.lang.String[] s,
java.io.Writer sbuf)
Write an Throwable as HTML code. |
java.lang.String |
doFormat(ExtendedLogRecord extRecord)
|
java.lang.String |
getContentType()
The Content type. |
java.lang.String |
getConversionPattern()
The conversionpattern. |
java.lang.String |
getFooter()
The footer. |
java.lang.String |
getHead(java.util.logging.Handler h)
|
java.lang.String |
getHeader()
Returns appropriate HTML headers. |
(package private) void |
getInternalCSS(java.lang.StringBuffer buf)
Generate an internal CSS file. |
java.lang.String |
getTail(java.util.logging.Handler h)
|
java.lang.String |
getTitle()
Returns the current value of the Title option. |
java.lang.String |
getURL2ExternalCSS()
Return the URL to the external CSS file. |
boolean |
ignoresThrowable()
The HTML layout handles the throwable contained in logging events. |
boolean |
isInternalCSS()
Returns the value of the internalCSS option. |
void |
setConversionPattern(java.lang.String conversionPattern)
Set the ConversionPattern option. |
void |
setInternalCSS(boolean internalCSS)
Set the value of the internalCSS option. |
void |
setTitle(java.lang.String title)
The Title option takes a String value. |
void |
setURL2ExternalCSS(java.lang.String url2ExternalCss)
Set the URL for the external CSS file. |
| Methods inherited from class org.x4juli.global.components.AbstractFormatter |
format, format, formatMessage, getLogger, getLoggerRepository, getMessageProperties, getNonFloodingLogger, getProperty, getProperty, getProperty, resetErrorCount, setIgnoresThrowable, setObjectStore |
| Methods inherited from class java.util.logging.Formatter |
formatMessage |
| 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.ExtendedFormatter |
formatMessage |
| Field Detail |
protected static final java.lang.String TRACE_PREFIX
private static final java.lang.String PATTERN_RULE_REGISTRY
LoggerRepositoryHolder object store.
private java.lang.String pattern
private java.lang.String title
private boolean internalCSS
private java.lang.String url2ExternalCSS
private boolean chainHandlesThrowable
private long counter
private LogRecordPatternConverter[] patternConverters
private FormattingInfo[] patternFields
| Constructor Detail |
public HTMLFormatter()
PatternFormatter.DEFAULT_CONVERSION_PATTERN.
The default pattern just produces the application supplied message.
public HTMLFormatter(java.lang.String pattern)
pattern - to format logrecords.| Method Detail |
public java.lang.String doFormat(ExtendedLogRecord extRecord)
doFormat in class AbstractFormatterFormatter.format(java.util.logging.LogRecord)public 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.
public void setConversionPattern(java.lang.String conversionPattern)
conversionPattern - controls formatting.public java.lang.String getConversionPattern()
public void setTitle(java.lang.String title)
Defaults to 'x4juli Log Messages'.
title - of the page.public java.lang.String getTitle()
public boolean isInternalCSS()
setInternalCSS(boolean)
method for details about the meaning of this option.
public void setInternalCSS(boolean internalCSS)
By default, internalCSS value is set to false, that is, by
default, only a link to an external CSS file will be generated.
internalCSS - to use or not.setURL2ExternalCSS(java.lang.String)public java.lang.String getURL2ExternalCSS()
setURL2ExternalCSS(java.lang.String)
method for details about the meaning of this option.
public void setURL2ExternalCSS(java.lang.String url2ExternalCss)
url2ExternalCss - URL where to find the CSS.public java.lang.String getContentType()
public java.lang.String getHeader()
public java.lang.String getFooter()
public java.lang.String getHead(java.util.logging.Handler h)
public java.lang.String getTail(java.util.logging.Handler h)
public boolean ignoresThrowable()
false.
ignoresThrowable in interface ExtendedFormatterignoresThrowable in class AbstractFormatter
void appendThrowableAsHTML(java.lang.String[] s,
java.io.Writer sbuf)
throws java.io.IOException
s - the throwable as String array.sbuf - where to append the output.
java.io.IOException - if write fails.void getInternalCSS(java.lang.StringBuffer buf)
buf - The StringBuffer where the CSS file will be placed.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||