users@jersey.java.net

Re: [Jersey] log HTTP exchanges

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 12 Nov 2009 11:01:35 +0100

On Nov 11, 2009, at 1:22 PM, Ari Heino wrote:

>
>
>
> Paul Sandoz wrote:
>>
>>
>> On Aug 12, 2009, at 3:06 PM, Ari Heino wrote:
>>
>>>
>>> Any thoughts on having this jersey logging filter using f.e. log4j
>>> configurations? Or is it already using them or anything like that?
>>>
>>
>> Jersey uses JDK logging. So you will need to use a "bridge" to
>> another
>> logging framework, for example:
>>
>>
>> http://blog.cn-consult.dk/2009/03/bridging-javautillogging-to-slf4j.html
>>
>> It is also possible to redirect JDK logging as appropriate:
>>
>> http://java.sun.com/javase/6/docs/technotes/guides/logging/index.html
>>
>> Paul.
>>
>>
>
> I actually ment any logging configurations, not that i need/want
> explicitly
> to use log4j instead of java.util.logging.
>
> So the question is how would I use java.util.logging properties file
> to turn
> on/off LoggingFilter?
>

OK.


> Been trying adding
>
> com.sun.jersey.api.container.filter.LoggingFilter.level=OFF
>
> without any success.

That should work, but are you sure your logging properties file is
getting loaded?

Are you using GlassFish? If so i think you might be able to utilize
the admin console:

   http://wiki.glassfish.java.net/Wiki.jsp?page=FaqConfigureLogging

I dunno if you can add logging properties to a war file. The best
place to ask is on the GF users list.

Paul.