Skip to content
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

Adding event extraction & formatter customization #5

Merged
merged 3 commits into from
Nov 6, 2018
Merged

Adding event extraction & formatter customization #5

merged 3 commits into from
Nov 6, 2018

Conversation

Al-un
Copy link
Contributor

@Al-un Al-un commented Nov 1, 2018

When lograge-sql works well when Lograge raw format is used, it might not be convenient to have a concatenated string when using Lograge JSON format. More globally, this suggestion allows a bit of flexibility:

  • Log output can be customized via a formatter
  • The formatter is fed by a event extractor. This allows user to extract additional fields (e.g. payload[:cached]
  • Such customization are accessible via a Railtie. If no configuration is done, it works as currently defined and this change is completely invisible

Being a Ruby beginner, feel free to correct the code


For reference, ActiveRecord default event extractor and formatter:
https://www.rubydoc.info/gems/activerecord/ActiveRecord/LogSubscriber#sql-instance_method

Al-un added 3 commits November 1, 2018 11:02
Extraction from SQL event log and Log formatting can be customized by Procs
Adding Railtie
Version moved from 0.2.0 to 0.2.1
Copy link
Owner

@iMacTia iMacTia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @Al-un and thanks for this massive contribution!
I like the customisation feature and I'm sure it will help a lot of developers.
I'm more than happy to merge it in and release a new version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants