I'm able to get the LoggingFeature to work by adding it as you've shown. 
You shouldn't need to call `enable`, and the `
isEnabled(LoggingFeature.class)` isn't expected to return true - here's the 
underlying code which is 
called: 
https://github.com/jersey/jersey/blob/3582ef0fab94352f2a9949cca9cb082bc750f07b/core-common/src/main/java/org/glassfish/jersey/model/internal/CommonConfig.java#L313-L316.
 
You can see when registering the feature it is added to the `
newFeatureRegistrations` in that class, which isn't checked by `isEnabled`.

One thing to double check might be that the logger for `
org.glassfish.jersey.logging.LoggingFeature` is enabled at DEBUG level in 
your YAML config.

-- Philip

On Sunday, July 31, 2016 at 2:48:38 PM UTC-5, x120 wrote:
>
> I've got same problem, have you figured it out?
>
> On Friday, 22 July 2016 16:51:35 UTC+1, t0tec wrote:
>>
>> Since Jersey 2.23 LoggingFilter is deprecated, I'm trying to get it 
>> working with the new LoggingFeature of Jersey but can't figure it out.
>>
>>     environment.jersey().register(new 
>> LoggingFeature(Logger.getLogger(LoggingFeature.DEFAULT_LOGGER_NAME), 
>> LoggingFeature.Verbosity.PAYLOAD_ANY));
>>     environment.jersey().enable("LoggingFeature");
>>
>>     
>> System.out.println(environment.jersey().getResourceConfig().isEnabled(LoggingFeature.class));
>>
>>
>> Sources:
>>
>> https://jersey.java.net/documentation/latest/logging_chapter.html#logging
>>
>> http://stackoverflow.com/questions/17213568/how-to-log-json-responses-in-dropwizard-jersey
>>
>> I'm using Dropwizard 1.0.0-rc5 + Jersey 2.23
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"dropwizard-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to