vectordotdev / timber-elixir

🌲 Great Elixir logging made easy
https://timber.io
Other
214 stars 29 forks source link

:gen_event handler exception -- how to debug? #334

Closed ryanwinchester closed 5 years ago

ryanwinchester commented 5 years ago

Any thoughts on how to I debug this :gen_event handler Timber.LoggerBackends.HTTP exception?

I don't even know where to begin on this one.

:gen_event handler Timber.LoggerBackends.HTTP installed in Logger terminating
** (exit) an exception was raised:
    ** (ArgumentError) Custom Event data must be a map
        (timber) lib/timber/event.ex:41: Timber.Event.to_api_map/1
        (elixir) lib/map.ex:589: Map.update/4
        (timber) lib/timber/log_entry.ex:190: Timber.LogEntry.to_map!/2
        (elixir) lib/enum.ex:1327: Enum."-map/2-lists^map/1-0-"/2
        (timber) lib/timber/logger_backends/http.ex:379: Timber.LoggerBackends.HTTP.buffer_to_msg_pack/1
        (timber) lib/timber/logger_backends/http.ex:323: Timber.LoggerBackends.HTTP.issue_request/1
        (timber) lib/timber/logger_backends/http.ex:178: Timber.LoggerBackends.HTTP.handle_info/2
        (stdlib) gen_event.erl:577: :gen_event.server_update/4

I've done a find all for event: and every logger call I've made myself is like Logger.whatever("msg", event: %{foo: "bar"})

What else can I do?

ryanwinchester commented 5 years ago

Another issue showing up, looks similarish?

:gen_event handler Timber.LoggerBackends.HTTP installed in Logger terminating
** (exit) an exception was raised:
    ** (FunctionClauseError) no function clause matching in Timber.Eventable.Map.to_event/1
        (timber) lib/timber/eventable.ex:78: Timber.Eventable.Map.to_event(%{cleared_count: 0, new_count: 0, unchanged_count: 0})
        (timber) lib/timber/log_entry.ex:158: Timber.LogEntry.extract_message_and_event/2
ryanwinchester commented 5 years ago

Removing timber for now.