reidmorrison / rails_semantic_logger

Rails Semantic Logger replaces the Rails default logger with Semantic Logger
https://logger.rocketjob.io/rails
Apache License 2.0
321 stars 115 forks source link

Omit request and response from output #111

Closed ball-hayden closed 3 years ago

ball-hayden commented 3 years ago

Follow on from https://github.com/rocketjob/rails_semantic_logger/pull/110

Description of changes

This avoids infinite recursion while trying to serialise Request and Response objects.

I'm not 100% comfortable with this, but neither ActionDispatch::Request nor ActionDispatch::Response objects can be serialised with to_json under Rails 6.1.rc1.

This work-around is possibly a bit too much of a hammer?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

reidmorrison commented 3 years ago

Let's try this patch, we can always undo the changes later if we find there is value in logging parts of the request or response objects from the payload.

Can you try Rails Semantic Logger from master and let me know if we need anything else fixed in the Rails monkey patching code?

ball-hayden commented 3 years ago

Can you try Rails Semantic Logger from master and let me know if we need anything else fixed in the Rails monkey patching code?

We're running this branch in production now and haven't found any notable issues, but I'll keep an eye out 👍