Try: wc.getInInterceptors().add(new LoggingInInterceptor());
Colm. On Tue, Apr 21, 2020 at 12:50 AM masber masber <mas...@hotmail.com> wrote: > Dear apache cxf user community, > > how can I setup JAX-RS client logs programmatically in apache CXF? I > understand that this is the old way of doing things but still wanted to > give it a go. This is my client. > > I tried using LoggingInInterceptor and LoggingOutInterceptor without > success because I could not find the way to add it to the client. > > > List<Object> providers = new ArrayList<Object>(); > providers.add( new JacksonJaxbJsonProvider() ); > > WebClient wc = WebClient.create(this.base_url, > providers).path(this.shipmentsPath).header("account-number", > shipment.getContract().getCarrierApiUsername()); > > HTTPConduit conduit = WebClient.getConfig(wc).getHttpConduit(); > conduit.getClient().setConnectionTimeout(1000 * 5); > conduit.getClient().setReceiveTimeout(1000 * 5); > > conduit.getAuthorization().setUserName(shipment.getContract().getCarrierApiUserId()); > > conduit.getAuthorization().setPassword(shipment.getContract().getCarrierApiPassword()); > > Response response = > wc.type(MediaType.APPLICATION_JSON).accept(MediaType.APPLICATION_JSON_TYPE).post(shipment_payload); > > any advice? > > thank you very much > >