问题
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
- configure JDK logging the usual way ,
- bridge it to your favorite logging framework, or
- use whatever mechanism your application server may provide.
来源:https://stackoverflow.com/questions/3760305/outputting-jersey-logging-to-a-file