Search in sources :

Example 1 with LoggingFeature

use of org.glassfish.jersey.logging.LoggingFeature in project camel by apache.

the class BonitaAPIUtil method getInstance.

public static BonitaAPIUtil getInstance(BonitaAPIConfig bonitaAPIConfig) {
    if (instance == null) {
        instance = new BonitaAPIUtil();
        ClientConfig clientConfig = new ClientConfig();
        clientConfig.register(MultiPartFeature.class);
        clientConfig.register(JacksonJsonProvider.class);
        Logger logger = Logger.getLogger("org.bonitasoft.camel.bonita.api.util.BonitaAPIUtil");
        Feature feature = new LoggingFeature(logger, Level.INFO, null, null);
        clientConfig.register(feature);
        ClientBuilder clientBuilder = ClientBuilder.newBuilder().withConfig(clientConfig);
        Client client = clientBuilder.build();
        client.register(new JsonClientFilter());
        client.register(new BonitaAuthFilter(bonitaAPIConfig));
        instance.setWebTarget(client.target(bonitaAPIConfig.getBaseBonitaURI()));
    }
    return instance;
}
Also used : LoggingFeature(org.glassfish.jersey.logging.LoggingFeature) JsonClientFilter(org.apache.camel.component.bonita.api.filter.JsonClientFilter) ClientConfig(org.glassfish.jersey.client.ClientConfig) Logger(java.util.logging.Logger) Client(javax.ws.rs.client.Client) BonitaAuthFilter(org.apache.camel.component.bonita.api.filter.BonitaAuthFilter) Feature(javax.ws.rs.core.Feature) MultiPartFeature(org.glassfish.jersey.media.multipart.MultiPartFeature) LoggingFeature(org.glassfish.jersey.logging.LoggingFeature) ClientBuilder(javax.ws.rs.client.ClientBuilder)

Example 2 with LoggingFeature

use of org.glassfish.jersey.logging.LoggingFeature in project jersey by jersey.

the class AsyncJaxrsApplication method getSingletons.

@Override
public Set<Object> getSingletons() {
    final HashSet<Object> instances = new HashSet<Object>();
    instances.add(new LoggingFeature(Logger.getLogger(AsyncJaxrsApplication.class.getName()), LoggingFeature.Verbosity.PAYLOAD_ANY));
    return instances;
}
Also used : LoggingFeature(org.glassfish.jersey.logging.LoggingFeature) HashSet(java.util.HashSet)

Example 3 with LoggingFeature

use of org.glassfish.jersey.logging.LoggingFeature in project jersey by jersey.

the class ErrorTest method configure.

@Override
protected Application configure() {
    ResourceConfig config = new ResourceConfig(ErrorResource.class);
    config.register(new LoggingFeature(LOGGER, LoggingFeature.Verbosity.PAYLOAD_ANY));
    return config;
}
Also used : LoggingFeature(org.glassfish.jersey.logging.LoggingFeature) ResourceConfig(org.glassfish.jersey.server.ResourceConfig)

Example 4 with LoggingFeature

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 GrizzlyConnectorProvider());
}
Also used : LoggingFeature(org.glassfish.jersey.logging.LoggingFeature)

Example 5 with LoggingFeature

use of org.glassfish.jersey.logging.LoggingFeature in project jersey by jersey.

the class FollowRedirectsTest method configure.

@Override
protected Application configure() {
    ResourceConfig config = new ResourceConfig(RedirectResource.class);
    config.register(new LoggingFeature(LOGGER, LoggingFeature.Verbosity.PAYLOAD_ANY));
    return config;
}
Also used : LoggingFeature(org.glassfish.jersey.logging.LoggingFeature) ResourceConfig(org.glassfish.jersey.server.ResourceConfig)

Aggregations

LoggingFeature (org.glassfish.jersey.logging.LoggingFeature)45 ResourceConfig (org.glassfish.jersey.server.ResourceConfig)33 Response (javax.ws.rs.core.Response)6 Client (javax.ws.rs.client.Client)4 WebTarget (javax.ws.rs.client.WebTarget)4 ContainerRequestContext (javax.ws.rs.container.ContainerRequestContext)4 ContainerRequest (org.glassfish.jersey.server.ContainerRequest)4 Resource (org.glassfish.jersey.server.model.Resource)4 ClientConfig (org.glassfish.jersey.client.ClientConfig)2 MultiPartFeature (org.glassfish.jersey.media.multipart.MultiPartFeature)2 Test (org.junit.Test)2 MetricRegistry (com.codahale.metrics.MetricRegistry)1 UserPrincipal (com.sun.security.auth.UserPrincipal)1 InputStream (java.io.InputStream)1 URI (java.net.URI)1 Principal (java.security.Principal)1 HashSet (java.util.HashSet)1 ExecutorService (java.util.concurrent.ExecutorService)1 Logger (java.util.logging.Logger)1 ClientBuilder (javax.ws.rs.client.ClientBuilder)1