Outputting Jersey logging to a file?

我们两清 提交于 2019-12-05 21:52:28

问题


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>

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.

Examples would be nice! Thanks


回答1:


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

  1. configure JDK logging the usual way ,
  2. bridge it to your favorite logging framework, or
  3. use whatever mechanism your application server may provide.


来源:https://stackoverflow.com/questions/3760305/outputting-jersey-logging-to-a-file

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