cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From masber masber <mas...@hotmail.com>
Subject how to setup JAX-RS logs programatically
Date Mon, 20 Apr 2020 23:50:25 GMT
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


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message