如何禁用速度日志 [英] How to disable velocity logs

查看:145
本文介绍了如何禁用速度日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直试图禁用Velocity日志,到目前为止我发现的唯一方法是设置:

I've been trying to disable Velocity logs, and the only way I've found so far with positive results is to set:

runtime.log.logsystem.class=org.apache.velocity.runtime.log.NullLogSystem

但位于velocity.jar内的velocity.properties内。

but inside the velocity.properties that resides inside the velocity.jar.

我在Web应用程序(tomcat)上下文中使用了velocity。有没有办法禁用速度(通过设置以前的属性或其他)但不修改JAR ??

I'm using velocity in a Web Application (tomcat) context. Is there any way to disable the velocity (by setting the previous property or whatever) BUT without modifying the JAR??

无法修改任何代码

提前致谢

推荐答案

一般:只需添加以下内容到你的 velocity.properties

In general: just add following line to your velocity.properties :

runtime.log.logsystem.class=org.apache.velocity.runtime.log.NullLogChute

问题
这取决于速度引擎的加载方式。是否可以为其提供自定义 velocity.properties 文件?
例如Solr的 VelocityResponseWriter 有一个名为 v.properties 的属性(或 init。当前版本中的properties.file
看,如果在代码中某处调用方法 org.apache.velocity.app.VelocityEngine.init(属性) ...

To your question: It depends on how the velocity engine is loaded. Is it possible to give it a custom velocity.properties file?
For example Solr's VelocityResponseWriter has such property called v.properties (or init.properties.file in current versions).
Look, if the method org.apache.velocity.app.VelocityEngine.init(Properties) is called somewhere in the code...

这篇关于如何禁用速度日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆