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.
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 inLogist::Formatter::Json#normalize_message
before converting back to JSON. It seems like it would be simpler to instead useconfig.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 Railslogger
.