Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Outputting Jersey logging to a file?

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

like image 888
phil Avatar asked Sep 21 '10 12:09

phil


1 Answers

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.
like image 51
Edward Samson Avatar answered Nov 12 '22 13:11

Edward Samson