logger_logstash_backend
logger_logstash_backend copied to clipboard
ambiguous match errors
I'm troubleshooting some oddball issues where I am appear to have the same config and versions of this lib included in 2 projects but only one works.
Wondering if you'd be open to including a function that gives a better clue to what's happening here. If so I can fork and make a PR
09:31:53.909 [error] GenServer #PID<0.4762.0> terminating
** (stop) {:EXIT, {{:badmatch, {:error, :badarg}}, [{LoggerLogstashBackend, :log_event, 5, [file: 'lib/logger_logstash_backend.ex', line: 61]}, {LoggerLogstashBackend, :handle_event, 2, [file: 'lib/logger_logstash_backend.ex', line: 36]}, {:gen_event, :server_update, 4, [file: 'gen_event.erl', line: 573]}, {:gen_event, :server_notify, 4, [file: 'gen_event.erl', line: 555]}, {:gen_event, :handle_msg, 6, [file: 'gen_event.erl', line: 296]}, {:proc_lib, :init_p_do_apply, 3, [file: 'proc_lib.erl', line: 247]}]}}
Running into this issue on certain requests, sort of randomly. Sometimes they work, sometimes they don't.
I'm guessing these errors are due to the event unable to be encoded as JSON.
(The line numbers don't match your example console error. I imagine that's because you are or were using an older version than the latest.)
I'm seeing these errors due to Erlang/OTP crash reports. The current version of this library does try to inspect PIDs in the :fields field but the crash reports seem to contain PIDs 'deeper' than just the top-level.
Here's a merge request in a fork of this repo that seems to (attempt to) address this, or at least the crash reports anyways: