Class: FunctionAppender


FunctionAppender extends SimpleLogAppender and implements the publishing of log messages by invocation of a custom function.

new FunctionAppender(level, category, functionToCall, objectToApplyToopt)

Constructor for FunctionAppender.
Name Type Argument Description
level String 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 The category this appender should listen to. If not specified the appender will get log for every available category. See SimpleLogAppender#setCategoryFilter.
functionToCall FunctionLogConsumer a well defined function to call passing log messages. The function will be invoked with a single String argument. If a more detailed insight on the message details is required it is suggested to implement a custom SimpleLogAppender.
objectToApplyTo Object <optional>
an instance of object to apply the functionToCall to.


Method Summary

Publish a log message by calling the specified function.

Inherited Methods

Method Detail

log(category, level, mex, header)

Publish a log message by calling the specified function.
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