将Jersey记录输出到文件? [英] Outputting Jersey logging to a file?
本文介绍了将Jersey记录输出到文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我们已将这些添加到我们的web.xml中:
We've added these to our web.xml:
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerRequestFilters</param-name>
<param-value>com.sun.jersey.api.container.filter.LoggingFilter</param-value>
</init-param>
<init-param>
<param-name>com.sun.jersey.spi.container.ContainerResponseFilters</param-name>
<param-value>com.sun.jersey.api.container.filter.LoggingFilter</param-value>
</init-param>
这在我的开发环境中调试很好,但是,我看不到任何关于日志记录的例子这些东西到我们的测试服务器上的文件!我只看到默认值是System.out ...而不是如何传递任何东西。
Which is nice for debugging in my dev environment, but, I can't see any examples on logging these things to files on our testing server! All I see is that the default is System.out... not how to pass in anything.
示例会很好!谢谢
推荐答案
默认情况下,LoggingFilter会记录到名为其完全限定类名的JDK记录器(com.sun.jersey.api) .container.filter.LoggingFilter)。你只需
By default, LoggingFilter logs to a JDK logger named as its fully qualified class name (com.sun.jersey.api.container.filter.LoggingFilter). You'll just have to
- configure JDK logging the usual way ,
- bridge it to your favorite logging framework, or
- use whatever mechanism your application server may provide.
这篇关于将Jersey记录输出到文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文