Nebo15 / logger_json

JSON logger formatter with support for Google Cloud, DataDog and other for Elixir.
https://nebo15.github.io/logger_json/
MIT License
237 stars 92 forks source link

feat: Use erl_level as severity #106

Closed sekiyama58 closed 6 months ago

sekiyama58 commented 1 year ago

Since Elixir 1.11.0, Logger supports syslog levels such as notice, critical, alert, and emergency to be passed in Logger's erl_level metadata.

Google Cloud Logger LogEntry also supports these as LogSeverity: https://cloud.google.com/logging/docs/reference/v2/rest/v2/LogEntry#LogSeverity

This PR makes these levels to be logged as severity.

Note that, for backward compatibility, this treats 'warn' as 'warning' level.

AndrewDryga commented 6 months ago

The new unreleased version (feel free to give master a try) is now just an Erlang's :logger formatted so we read the level directly from it. Thank you for PR anyway and sorry for taking so long to reply.