我一直试图禁用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...
更多推荐
如何禁用速度日志
发布评论