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

Simplifying lograge integration with Lograge::Formatters::Raw #19

Open
md5 opened this issue Jul 6, 2021 · 0 comments
Open

Simplifying lograge integration with Lograge::Formatters::Raw #19

md5 opened this issue Jul 6, 2021 · 0 comments

Comments

@md5
Copy link

md5 commented Jul 6, 2021

While reviewing this gem in the context of implementing JSON-formatted structured logs for our applications, I noticed that it is currently setting config.lograge.formatter = Lograge::Formatters::Json.new, then parsing JSON in Logist::Formatter::Json#normalize_message before converting back to JSON. It seems like it would be simpler to instead use config.lograge.formatter = Lograge::Formatters::Raw.new and skip the parsing step in #normalize_message. Is there some reason I'm missing that it's done the way it is? I can't think of another source that would be sending stringified JSON to the Rails logger.

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

No branches or pull requests

1 participant