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

PIXBR-359 adding datadog logger #64

Closed luizfelipead closed 3 years ago

luizfelipead commented 3 years ago

Proposal

Jira Card: PIXBR-359

This PR aims to configure a json format for our logs using LoggerJSON to improve usability in datadog.

Implementation Details

We created a fork of the library LoggerJSON so we can use it in house. We also created and configured a datadog_logger module based on an existent formatter (but still not released) from the same library. By changing and customizing some log fields, datadog can now understand log severity, timestamp, mfa, etc as the image below:

Screen Shot 2021-02-10 at 12 13 14

To make it work, we changed the attribute message to msg and configured a message remapper in datadog specific for our service:

Screen Shot 2021-02-10 at 12 47 57