Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.owasp.dependencycheck.reporting
Class VelocityLoggerRedirect

    java.lang.Object
      org.owasp.dependencycheck.reporting.VelocityLoggerRedirect

All Implemented Interfaces:
  org.apache.velocity.runtime.log.LogChute

    public class VelocityLoggerRedirect

extends Object
implements org.apache.velocity.runtime.log.LogChute

DependencyCheck uses `Logger` as a logging framework, and Apache Velocity uses a custom logging implementation that outputs to a file named velocity.log by default. This class is an implementation of a custom Velocity logger that redirects all velocity logging to the Java Logger class.

This class was written to address permission issues when using Dependency-Check in a server environment (such as the Jenkins plugin). In some circumstances, Velocity would attempt to create velocity.log in an un-writable directory.

Author:
  Steve Springett (steve.springett@owasp.org)

Field Summary

Fields inherited from interface org.apache.velocity.runtime.log.LogChute
`DEBUG_ID, DEBUG_PREFIX, ERROR_ID, ERROR_PREFIX, INFO_ID, INFO_PREFIX, TRACE_ID, TRACE_PREFIX, WARN_ID, WARN_PREFIX`

Constructor Summary
`VelocityLoggerRedirect()`

Method Summary
`void` | `init(org.apache.velocity.runtime.RuntimeServices rsvc)` This will be invoked once by the LogManager.
`boolean` | `isLevelEnabled(int level)` Will always return true.
`void` | `log(int level, String message)` Given a Velocity log level and message, this method will call the appropriate Logger level and log the specified values.
`void` | `log(int level, String message, Throwable t)` Given a Velocity log level, message and Throwable, this method will call the appropriate Logger level and log the specified values.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### VelocityLoggerRedirect

    public VelocityLoggerRedirect()

Method Detail

### init

    public void init(org.apache.velocity.runtime.RuntimeServices rsvc)

  This will be invoked once by the LogManager.

  Specified by:
    `init` in interface `org.apache.velocity.runtime.log.LogChute`
  Parameters:
    `rsvc` - the RuntimeServices

### log

    public void log(int level,
                    String message)

  Given a Velocity log level and message, this method will call the appropriate Logger level and log the specified values.

  Specified by:
    `log` in interface `org.apache.velocity.runtime.log.LogChute`
  Parameters:
    `level` - the logging level
    `message` - the message to be logged

### log

    public void log(int level,
                    String message,
                    Throwable t)

  Given a Velocity log level, message and Throwable, this method will call the appropriate Logger level and log the specified values.

  Specified by:
    `log` in interface `org.apache.velocity.runtime.log.LogChute`
  Parameters:
    `level` - the logging level
    `message` - the message to be logged
    `t` - a throwable to log

### isLevelEnabled

    public boolean isLevelEnabled(int level)

  Will always return true. The property file will decide what level to log.

  Specified by:
    `isLevelEnabled` in interface `org.apache.velocity.runtime.log.LogChute`
  Parameters:
    `level` - the logging level
  Returns:
    true

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012-2013 OWASP. All Rights Reserved.