Apache » Cocoon »

  Cocoon Core

Cocoon Core 2.2

Logging configuration


Cocoon uses Log4j library for logging and uses it quite extensively so log files can be very valuable source of information how things are performed. There are five standard log levels to choose in order to limit amount of information dumped to log files:

  • WARN
  • INFO
In production environment it is reasonable to set a log level to ERROR or FATAL_ERROR so only very important events are logged (like crashes). While developing an application you would probably like to see much more. It's up to you to choose an approporiate log level; little experimantation will give you sense of each setting.

Tweaking the configuration

Configuration in Cocoon is handled by Spring configurator, go there for general information.

How to set up a log level

Note: Instructions put below assume that you have created a block according to this tutorial. Please refer to it, first.
Steps that you need to perform:
  1. create a properties subfolder in your block:
  2. create a new file in that folder that should have as ending .properties, e.g. settings.properties
  3. inside that file you have to put this line if you want to set log level to DEBUG:
That's all! Restart your webapp and you should see now a detailed log information in a file in: