[
https://issues.apache.org/jira/browse/CAMEL-21468?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17904212#comment-17904212
]
Claus Ibsen commented on CAMEL-21468:
-------------------------------------
The second best we can do is to trap this a little bit before / after http
client, but it seems that its doable.
I wonder if we should log similar to curl (using -v) or avoid the leading > and
< chars and just log cleanly.
> 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)