shadabahmed / logstasher

Awesome rails logs
MIT License
817 stars 136 forks source link

active_record/log_subscriber: fix SystemStackError on Rails 6 #151

Closed kyrylo closed 3 years ago

kyrylo commented 4 years ago

When running migrations on Rails 6 logstasher tries to log stuff but chokes on SystemStackError:

SystemStackError: stack level too deep
...
/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/json.rb:172:in `map'
/gems/activesupport-6.0.2.2/lib/active_support/core_ext/object/json.rb:172:in `as_json'"

The problem is that Rails 6 started adding :connection object to the event object, and it cannot be dumped to JSON due to the error above, and therefore making the whole app useless.

kyrylo commented 4 years ago

Note: this includes my old patch https://github.com/shadabahmed/logstasher/pull/148 and needs a proper rebase. I can do it after https://github.com/shadabahmed/logstasher/pull/148 is merged.

For everybody else who still use this gem, just use my fork: https://github.com/airbrake/logstasher

petergoldstein commented 3 years ago

@shadabahmed I believe this can now be closed.

@kyrylo, this change was merged in PR #160

shadabahmed commented 3 years ago

This change is merged. Thanks @kyrylo and @petergoldstein for all your work