Class: DOMAppender

DOMAppender

DOMAppender extends SimpleLogAppender and implements the publishing of log messages by incrementally extending the text content of a supplied container DOM object. Log lines are separated by <br> elements.

new DOMAppender(level, category, DOMObj)

Constructor for DOMAppender.
Parameters:
Name Type Argument Description
level String <optional>
The threshold level at which the SimpleLogAppender is created. It should be one of "DEBUG", "INFO", "WARN", "ERROR" and "FATAL". If not or wrongly specified INFO is assumed.
category String <optional>
The category this appender should listen to. If not specified the appender will get log for every available category. See SimpleLogAppender#setCategoryFilter.
DOMObj DOMElement The DOM object to use for log message publishing.
Throws:
if the DOMElement parameter is missing.
Type
IllegalArgumentException

Extends

Method Summary

log
Publish a log message on the specified DOM object.
setNextOnTop
Setter method that specifies if new log messages have to be shown on top of the previous ones.
setUseInnerHtml
Setter method that specifies how new log lines have to be included in the given container DOM object.

Inherited Methods

Method Detail

log(category, level, mex, header)

Publish a log message on the specified DOM object.
Parameters:
Name Type Description
category String the logger category that produced the given message.
level String the logging level of the given message. It should be one of DEBUG INFO WARN ERROR FATAL.
mex String the message to be logged. It could be a String instance, an Error instance or any other object, provided that it has a toString method.
header String a header for the message

setNextOnTop(nextOnTop)

Setter method that specifies if new log messages have to be shown on top of the previous ones.
Parameters:
Name Type Argument Description
nextOnTop boolean <optional>
Layout of log messages in the DOM object; if true the newest log line is displayed on top of DOM object. false by default.

setUseInnerHtml(useInnerHtml)

Setter method that specifies how new log lines have to be included in the given container DOM object. In fact, some log lines may contain custom parts (for instance, field values) that may be expressed in HTML and intended for HTML rendering. In this case, instead of putting the log messages in text nodes, the appender can be set for directly adding messages to the innerHTML of the container object.
WARNING: When turning HTML interpretation on, make sure that no malicious code may reach the log.
Parameters:
Name Type Description
useInnerHtml boolean Flag to switch On/Off the use of innerHTML. false by default.