Closed notresponding2u closed 2 years ago
IMO This bundle shouldn't be tied to Doctrine directly. It should log to monolog (which it already does) and then Monolog should be set up to write to Doctrine.
That way it's a lot easier to switch where to log to without having to change anything in the Guzzle Middleware.
| Symfony version | 5.3.6 | Guzzle version | 8.2
I am trying to make a guzzle plugin, for all clients. Which logs the requests.
What I am trying to do, is to get the EntityManager in the plugin and pass it to the middleware. This is probably the wrong approach, and this is what I need help with - how to get the entity manager in the middleware.
So far I get this error when I try to get the entity manager from the container object in the plugin:
What I want is to use the entity manager into the middleware, to be able to save a log entry. How to do that?
Here is the conf for guzzle:
Here is the plugin:
And here is the middleware:
Here is a test that I use to try it out:
Here we get the entity manager, but we fail in the plugin itself. It looks it can't figure out the configs.
Also link to the whole project here