在 struts2 VelocityResult 类中抑制 ClientAbortException [英] Suppress ClientAbortException in struts2 VelocityResult class

查看:32
本文介绍了在 struts2 VelocityResult 类中抑制 ClientAbortException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的日志文件中得到以下堆栈跟踪,并希望仅在日志中显示这个错误:

I am getting the following stack trace in my log file and was wanting to suppress just this error from displaying in the log:

错误 08-09-26 14:48:45.141http-80-215org.apache.struts2.dispatcher.VelocityResult:无法渲染速度模板,'/jsondata.vm' ClientAbortException:java.net.SocketException: 管道损坏

ERROR 08-09-26 14:48:45.141 http-80-215 org.apache.struts2.dispatcher.VelocityResult: Unable to render Velocity Template, '/jsondata.vm' ClientAbortException: java.net.SocketException: Broken pipe

我了解导致错误的原因,并且在这个特定用例中并不是特别例外;我只想禁止在日志文件中显示 ClientAbortException,而是显示调试级别的消息.

I understand what causes the error, and it is not really exceptional in this particular use case; I just want to suppress the ClientAbortException from displaying in the log file, but display a debug level message instead.

推荐答案

作为一种解决方法,您可以将 org.apache.struts2.dispatcher.VelocityResult 类的日志级别设置为 fatal.

As a workaround you can set log level for the class org.apache.struts2.dispatcher.VelocityResult to fatal.

这篇关于在 struts2 VelocityResult 类中抑制 ClientAbortException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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