| Implementation of a LogSystem using Commons Logging to route Velocity message
through a IsolatedLog4JLogger setup.
Configure the following in your velocity.properties:
- runtime.log.logsystem.class=org.apache.jetspeed.webapp.logging.velocity.CommonsLoggingLog4JLogSystem
- runtime.log.logsystem.log4j.category=<a Log4J Category name to capture Velocity message, default value: "velocity">
For further information about setting up and configuring velocity:
Velocity - Developer's Guide
If you want to use a VelocityEngine instantiated by Spring using its org.springframework.ui.velocity.VelocityEngineFactoryBean
then you can also configure the above properties inline in its defintion or point it to your velocity.properties file.
But, beware of the following: the VelocityEngineFactoryBean by default overrides logging any configuration and hooks up their own
CommonsLoggingLogSystem. Which works fine just as this one, but uses as (hard coded) logging category the VelocityEngine class name.
So, if you do want to route your Velocity logging using your own category (or our default "velocity"), then you need to override the
VelocityEngineFactoryBean default logging setup by setting its "overrideLogging" property to false.
author: Ate Douma version: $Id$ |