Helma Logo
main list history
previous version  overview  next version

Version 2 by hannes on 16. May 2008, 11:37

The *helma.logging module|http://dev.helma.org/trac/helma/browser/helma-ng/trunk/modules/helma/logging.js* provides logging functionality using *Apache log4j|http://logging.apache.org/log4j/1.2/index.html*.

helma.logging can be configured by passing a log4j XML or properties configuration file to the setConfig() method. The default configuration is file *modules/helma/log4j.properties|http://dev.helma.org/trac/helma/browser/helma-ng/trunk/modules/helma/log4j.properties*.

Helma provides a special Appender class called org.helma.util.RhinoAppender that allows to send log messages to a Javascript *callback* function. The logging module provides the methods startResponseLog() enableResponseLog() and stopResponseLog() disableResponseLog() to enable and disable appending of RhinoAppender log messages to a response buffer, using similar formatting as res.debug in Helma 1.

  importModule('helma.logging', 'logging');
  logging.startResponseLog();enableResponseLog();
  var log = logging.getLogger('modulename');
  ...
  log.info("log message");

     removed
     added