Disable logging of Exception in Bean

戏子无情 提交于 2019-12-13 07:23:46

问题


I'm using Wildfly 10 and JAX-RS (resteasy) and have a Bean being injected in another Bean:

@Path("foo")
public class FooResource {
    @Inject
    BarBean bar;
    ...
}

Then I'm calling a method on bar that throws a RuntimeException. I'm handling this Exception in FooResource, but Wildfly has interceptors that print the stack trace to the log. I don't want this to happen. Is there any way to disable this behavior?


回答1:


I could only reproduce this when the @Injected bean was a EJB (with Wildfly-9).

You can disable EJB exception logging through the webinterface (:9990)

Configuration -> Subsystems -> EJB 3 -> Log system exceptions Put this value to false and you should not see exceptions logged anymore.



来源:https://stackoverflow.com/questions/39656572/disable-logging-of-exception-in-bean

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!