ForzaElixir / rollbax

Exception tracking and logging from Elixir to Rollbar
https://hexdocs.pm/rollbax
ISC License
243 stars 52 forks source link

Issue with function clause after updated to 0.9 #91

Closed JonRowe closed 6 years ago

JonRowe commented 6 years ago

Sorry for the vague title, not sure how else to describe this. After updating to 0.9 from 0.8.2 I get a strange error from the rollbax back end when running my tests. I've tried cleaning my build and deps but it persists, any help would be greatly appreciated.

21:41:22.614 [error] :gen_event handler Rollbax.Logger installed at Logger
** (exit) an exception was raised:
    ** (FunctionClauseError) no function clause matching in Rollbax.Logger.handle_event/2
        (rollbax) lib/rollbax/logger.ex:62: Rollbax.Logger.handle_event(:flush, %Rollbax.Logger{reporters: [Rollbax.Reporter.Standard]})
        (stdlib) gen_event.erl:573: :gen_event.server_update/4
        (stdlib) gen_event.erl:555: :gen_event.server_notify/4
        (stdlib) gen_event.erl:299: :gen_event.handle_msg/6
        (stdlib) proc_lib.erl:247: :proc_lib.init_p_do_apply/3
whatyouhide commented 6 years ago

Okay, after digging a bit into this my guess is that you are still using Rollbax.Logger as a Logger backend by doing something like config :logger, backends: [Rollbax.Logger, :console] in your configuration. Rollbax.Logger is now a backend to :error_logger, not Logger, and :error_logger doesn't talk about :flush messages (while Logger does). Did I get it right?

JonRowe commented 6 years ago

Ah, yes, it'd be great if the documentation mentioned something about this change, would you accept a PR to that effect?

I'm thinking of adding something to "Crash Reports" along the lines of

- For more information, check out the documentation for Rollbax.Logger.
+ For more information, check out the documentation for Rollbax.Logger. This supersedes the need to add `config: :logger, backends: [Rollback.Logger]`
whatyouhide commented 6 years ago

Sure, a PR would be welcome!

JonRowe commented 6 years ago

Thanks so much, sorry to have wasted your time with a human error :)