Hello guys! I don’t understand how I can configure Elixir logger metadata which comes from Erlang/OTP internal entities. Let’s say I have config
config :logger,
level: :info,
backends: [{LogstashJson.Console, :logstash_json}],
handle_otp_reports: true,
handle_sasl_reports: false,
logstash_json: [
metadata: [
:application,
:module,
:file,
:function,
:level,
:line
]
]
where I explicitly define which metadata I want to be presented.
But sometimes when something like Task #PID<0.17871.20> started from TheBestApp terminating ** (MatchError)
happens then somehow crash_reason
metadata leaks to my JSON logs. Which is bad because this kind of metadata can’t be properly represented as JSON. How I can fix it? At least how I can say Logger to not put this metadata to output?