Nebo15 / logger_json

JSON logger formatter with support for Google Cloud, DataDog and other for Elixir.

Home Page:https://nebo15.github.io/logger_json/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Time, Severity, and Message should be merged after metadata in GoogleCloudLogger

StandardMikeBenza opened this issue · comments

I recently debugged an issue where my log messages weren't showing up as expected. I had introduced a log message that had time metadata (how long an operation took). Since LoggerJSON.Formatters.GoogleCloudLogger merges the metadata into the map of time, severity, and message, metadata time replaced the actual timestamp. The same would happen for severity or message.

This should at a minimum be documented. Ideally the time, severity, and message would be merged into the metadata. A plus would be some way of warning that the original value had been overwritten and recording the original value.

Hello @StandardMikeBenza, this was true but behaviour is changed in master branch and now it's not specific to the package. Logger in the latest Elixir versions works on top of Erlang one and it supplies time as a metadata attribute to the formatters. Not sure if you can override it now or now, but closing since there is nothing we can do about it.