Skip to content
This repository has been archived by the owner on Nov 9, 2017. It is now read-only.

Commit

Permalink
Send Velocity log to SLF4J (via Commons Logging)
Browse files Browse the repository at this point in the history
  • Loading branch information
seanf committed Sep 11, 2014
1 parent 1501295 commit a27f6a5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions zanata-war/src/main/java/org/zanata/email/EmailBuilder.java
Expand Up @@ -24,6 +24,7 @@
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.VelocityEngine;
import org.apache.velocity.runtime.RuntimeConstants;
import org.apache.velocity.runtime.log.CommonsLogLogChute;
import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;
import org.jboss.seam.annotations.AutoCreate;
import org.jboss.seam.annotations.In;
Expand Down Expand Up @@ -71,6 +72,11 @@ private static VelocityEngine makeVelocityEngine() {
ve.setProperty(RuntimeConstants.RESOURCE_LOADER, "classpath");
ve.setProperty("classpath.resource.loader.class",
ClasspathResourceLoader.class.getName());

// send Velocity log to SLF4J (via Commons Logging)
ve.setProperty(VelocityEngine.RUNTIME_LOG_LOGSYSTEM_CLASS,
CommonsLogLogChute.class.getName());

// this allows unit tests to detect missing context vars:
ve.setProperty("runtime.references.strict", true);
ve.init();
Expand Down

0 comments on commit a27f6a5

Please sign in to comment.