[ 
https://issues.apache.org/jira/browse/CAMEL-21468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17904149#comment-17904149
 ] 

Claus Ibsen edited comment on CAMEL-21468 at 12/9/24 1:10 PM:
--------------------------------------------------------------

I think you should report this to ASF Http Client as their client is not making 
this easy. They have hardcoded the logging 

 
private static final Logger HEADER_LOG = 
LoggerFactory.getLogger("org.apache.hc.client5.http.headers");
private static final Logger WIRE_LOG = 
LoggerFactory.getLogger("org.apache.hc.client5.http.wire");
 
In DefaultManagedHttpClientConnection
 
Maybe they could making it easier for Camel and other users of their client to 
hook in and get the data being send and received.


was (Author: davsclaus):
I think you should report this to ASF Http Client as their client is not making 
this easy. They have hardcoded the logging 

 

> camel-http - Add option to log raw request and raw response
> -----------------------------------------------------------
>
>                 Key: CAMEL-21468
>                 URL: https://issues.apache.org/jira/browse/CAMEL-21468
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-http
>    Affects Versions: 4.8.1
>            Reporter: Raymond
>            Priority: Minor
>
> I would like to see the raw request and response in the log when using the 
> http component. For this, the following component options could be added:
> 1. logRawRequest (or showRawRequest)
> 2. logRawResponse (or showRawResponse)
> Now this seems partly possible by setting the log file settings (for example 
> in log4j and logback). However, I often don't have access to these files. I 
> would like to have it similar to debugging in for example Google Chrome or 
> Postman, to quickly enable and disable on the endpoint.
> ----------------------
> Example of a background use case: 
> I have two routes, one with a Groovy script component and one that executes a 
> http call. This works fine when there is a queue between the routes, but not 
> when using a synchronous call with direct. My assumption is that when sending 
> the message to a JMS (ActiveMQ) queue the headers and body objects get 
> automatically converted, for example with a String method. I tried to find 
> out by setting a log component before it and after the http call, however 
> they seem to be the same. Still, one returns 200 and the other 400 
> (unfortunately no other info in the response, except that something is null). 
> Logging and comparing the raw request/response would help me see the 
> difference more easily. In this case setting the log file isn't that easy as 
> the log file is provisioned through terraform/docker and changing it would 
> change it also for other calls. The http endpoint is not reachable locally.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to