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

Add ignored_metadata option #103

Closed juliandicks closed 6 months ago

juliandicks commented 1 year ago

Remembering to add metadata fields to the matadata list is problematic, so here is a version that allows you to rather have a black list of tags you don't want which are added to the existing black list.

config :logger_json, :backend,
       metadata: :all,
       ignored_metadata: [:domain, :erl_level],
       json_encoder: Jason,
       formatter: LoggerJSON.Formatters.BasicLogger
aselder commented 1 year ago

I love this... Was just thinking about implementing this today.

AndrewDryga commented 6 months ago

This was fixed in the recent releases of LoggerJSON in a slightly different way: https://github.com/Nebo15/logger_json/blob/master/lib/logger_json.ex#L55. Thank you for PR anyways and sorry for such a long reply!