use of org.glassfish.jersey.logging.LoggingFeature in project jersey by jersey.
the class AsyncTest method configureClient.
@Override
protected void configureClient(final ClientConfig config) {
config.register(new LoggingFeature(LOGGER, LoggingFeature.Verbosity.PAYLOAD_ANY));
config.connectorProvider(new HttpUrlConnectorProvider());
}
use of org.glassfish.jersey.logging.LoggingFeature in project jersey by jersey.
the class ContentTypeTest method configure.
@Override
protected Application configure() {
enable(TestProperties.DUMP_ENTITY);
enable(TestProperties.LOG_TRAFFIC);
return new ResourceConfig().registerClasses(ContentTypeResource.class, ContentTypeFixFeature.class, FooBarStringWriter.class).registerInstances(new LoggingFeature(LOGGER, LoggingFeature.Verbosity.PAYLOAD_ANY));
}
use of org.glassfish.jersey.logging.LoggingFeature in project jersey by jersey.
the class OAuthClientServerTest method configure.
@Override
protected Application configure() {
final DefaultOAuth1Provider oAuthProvider = new DefaultOAuth1Provider();
oAuthProvider.registerConsumer(CONSUMER_NAME, CONSUMER_KEY, SECRET_CONSUMER_KEY, new MultivaluedHashMap<String, String>());
final Principal prometheusPrincipal = new Principal() {
@Override
public String getName() {
return "prometheus";
}
};
oAuthProvider.addAccessToken(PROMETHEUS_TOKEN, PROMETHEUS_SECRET, CONSUMER_KEY, "http://callback.url", prometheusPrincipal, Arrays.asList("admin", "user").stream().collect(Collectors.toSet()), new MultivaluedHashMap<String, String>());
final OAuth1ServerFeature oAuth1ServerFeature = new OAuth1ServerFeature(oAuthProvider, "requestTokenSpecialUri", "accessTokenSpecialUri");
final ResourceConfig resourceConfig = new ResourceConfig();
resourceConfig.register(oAuth1ServerFeature);
resourceConfig.register(MyProtectedResource.class);
resourceConfig.register(new LoggingFeature(Logger.getLogger(OAuthClientServerTest.class.getName()), LoggingFeature.Verbosity.PAYLOAD_ANY));
resourceConfig.register(OAuthAuthorizationResource.class);
resourceConfig.property(OAuth1ServerProperties.TIMESTAMP_UNIT, "SECONDS");
resourceConfig.property(OAuth1ServerProperties.MAX_NONCE_CACHE_SIZE, 20);
return resourceConfig;
}
use of org.glassfish.jersey.logging.LoggingFeature in project jersey by jersey.
the class MultiPartJerseyTest method configure.
@Override
protected Application configure() {
enable(TestProperties.LOG_TRAFFIC);
enable(TestProperties.DUMP_ENTITY);
return new ResourceConfig().registerClasses(getResourceClasses()).registerClasses(MultiPartBeanProvider.class).registerInstances(new LoggingFeature(LOGGER, LoggingFeature.Verbosity.PAYLOAD_ANY)).register(new MultiPartFeature());
}
use of org.glassfish.jersey.logging.LoggingFeature in project simba-os by cegeka.
the class JerseyExampleClient method main.
public static void main(String[] args) {
Client client = ClientBuilder.newClient();
client.register(HttpAuthenticationFeature.basic("admin", "Simba3D"));
client.register(new LoggingFeature(LOGGER));
WebTarget target = client.target("http://localhost:8080/simba/jersey/service/").path("hello");
try {
String result = target.request(MediaType.TEXT_PLAIN_TYPE).get(String.class);
System.out.println(result);
} finally {
client.close();
}
}
Aggregations