New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Optional debug logging #173
Conversation
Seriously the amount of hours I'm spending on debugging this... can this please be merged? |
Thanks - makes sense. I'd appreciate if anyone has time to send a README PR to add an example of how this can be configured to get logging enable though |
I can see this being a really useful feature and just found it out via changelog. However, when something ain't documented, nobody is using it. Currently, I am "reverse engineering" this feature to get it working... @4c0n Would you mind to share us how you intended this feature to be used? |
It's really easy, you override the service of the bundle and have your logger service injected. |
This is the approach I did, however, it is vulnerable to any BC changes. A better approach would be having the option to set When possible, would you mind still documenting this? In addition to this, adding logging also here, wouldn't hurt. For example, I had a case where one of the required headers wasn't allowed. NelmioCorsBundle/EventListener/CorsListener.php Lines 248 to 252 in b111f4b
|
BC changes should be in new major versions only, in which case you should review if your setup is compatible with the new version regardless. |
See #197 for docs for now.. But if anyone wants to improve this with docs or ideally a config option to enable logging that'd be great. |
Finding out what is going wrong in prod environments can be tricky sometimes.
This PR allows an optional logger to be passed which enables a debug log.
Now finding out what's happening is a breeze.