Helma Logo
main list history


The helma.logging module provides logging functionality using Apache log4j.

helma.logging can be configured by passing a log4j XML or properties configuration file to the setConfig() method. The default configuration is file modules/config/log4j.properties.

Helma provides a special Appender class called org.helma.util.RhinoAppender that allows to send log messages to a Javascript callback function.

var log = helma.logging.getLogger(module.id);

Then the following code ...

log.info("Hello world!");
try {
} catch (e) {
    log.error(e, e.rhinoException);

... will produce the following output on the rendered page:

3300 [pool-1-thread-2] INFO modulename - Hello world!
3303 [pool-1-thread-2] ERROR modulename - ReferenceError: "foo" is not defined.

Script Stack

javascript stack trace

Java Stack

java stack trace

Links to this page: Release 0.2