Helma Logo
main list history

Version 3 by hannes on 17. February 2009, 22:43

3=== Creating log messages from Helma apps
11=== Helma application and server logs
19=== Helma logging
41=== Apache log4j
43For those applications that require extended logging features, *Apache log4j|http://logging.apache.org/log4j/* is a very popular choice. There is a *Howto document|http://helma.org/docs/howtos/log4j/* howto document for setting up Helma with log4j*Helma and log4j*.

Version 2 by hypersmil on 16. January 2008, 12:00

11== Helma application an and server logs

Version 1 by hannes on 16. January 2008, 11:01

1This page gives an overview of the logging infrastructure provided by Helma.
3== Creating log messages from Helma apps
4
5The *global app object|http://helma.zumbrunn.com/reference/app.html* provides several methods for generating log messages from Helma applications:
6
7* *app.log()|http://helma.zumbrunn.com/reference/app.html#app.log*
8* *app.debug()|http://helma.zumbrunn.com/reference/app.html#app.debug*
9* *app.getLogger()|http://helma.zumbrunn.com/reference/app.html#app.getLogger*
10
11== Helma application an server logs
12
13Java logging frameworks usually separate logging output by class or package name of the originating class. Helma extends this scheme by adding one server log and several per-application logs. The server log is called "helma.server". The default application logs are the event log and the access log, called helma.<appname>.event and helma.appname.access, respectively.
14
15Additionally, Helma apps can be configured to log SQL statements issued by the Helma O/R layer using the logSql property in server.properties or app.properties:
16
17  logSql = true
18
19== Helma logging
20
21Helma uses *Apache Commons Logging|http://commons.apache.org/logging/* to allow users to plug in different logging implementations. Helma comes with its own logging implementation, which is used by default and should be sufficient for many applications. It features asynchronous output for high performance logging, automatic daily log file rotation, and gzip compression of archived log files.
22
23==== Logging Output
24
25Helma logging can be configured to log to files, which by default are located in the log subdirectory of the Helma installation, or to the console, which is useful during development. This is controlled using the <b>logdir</b> option in server.properties or app.properties, which contains the path of the directory in which to put the log files.
26
27  logdir = /var/log/helma/
28
29If the logdir property is set to "console", logging output will be written to standard output stream (java.lang.System.out).
30
31  logdir = console
32
33If logdir is not set in system.properties or app.properties, log files will be written to the /log subdirectory of the Helma installation.
34
35==== Log Levels
36
37Apache Commons Logging supports six log levels: "trace", "debug", "info", "warn", "error" and "fatal". The default log level for Helma logging is "info", meaning that log messages with lower levels "debug" and "trace" will be ignored. The log level for Helma logging can be set using the helma.loglevel system property.
38
39  java -Dhelma.loglevel=debug -jar launcher.jar
40
41== Apache log4j
42
43For those applications that require extended logging features, *Apache log4j|http://logging.apache.org/log4j/* is a very popular choice. There is a *Howto document|http://helma.org/docs/howtos/log4j/* for setting up Helma with log4j.