Closed UnbekanntesPferd closed 1 year ago
You could use debugRequest
and debugResponse
methods on a connector I think: https://docs.saloon.dev/digging-deeper/debugging
My understanding of those methods is, that they are more or less a wrapper for the onRequest/onResponse middleware methods. So in this case I would again only be able to log just the request or just the response. Or am I wrong?
It would be enough to have information about the request somewhere in "onResponse", I would say. But it seems it's not there.
the $response
parameter you receive in debugResponse
closure is a saloon response class and that class has getRequest()
/getPendingRequest()
/getPsrRequest()
methods
That was way easier than expected. Thanks a lot! 👍
Thanks for the response @gdebrauwer! Yep this is a good way of logging.
Hi! I want to log every request and response of a connector. To just log the request I could use something like in the example, but at that early stage there is no response. Do we have any hook or event that can be used to log request, response and maybe even more information from guzzle (e.g. request time) in one method?