What would be the best way to log all guzzle requests to the php debugbar?
Normally there would be some type of event that is fired which I could listen for and pass the data to a collector for the debug bar. However, guzzle doesn't seem to have any events. Instead it is using middle ware and handlers which I don't quite understand how I would integrate with the debugbar to log requests and timeline, execution duration info to the debug bar.
I think I have mostly figured this out.
I created my own middleware and registered it with the client.
Custom middleware.
Registering custom middleware with handler stack – PHP League container used.
I was having a difficult time understanding the workflow of the handlers and promises until I actually looked into the promise library alone. Once I did that everything made much more sense.