I’ve written a custom Logger backend that logs stuff in Rollbar, using the library Rollbax and I’m not able to make it work using distillery releases.
This is the implementation of the logger backend: https://gist.github.com/antoniobg/5654c9e3f00dab71eb73c94d3dcaf86f
This is the config file
config :logger,
level: :info,
backends: [:console, {RollbaxLoggerBackend, :rollbar_logger}],
utc_log: true
config :logger, :rollbar_logger, level: :warn
An example of the code that fails in the release (running it through bin/my_app remote_console
)
require Logger
Logger.warn("this shoud be sent to Rollbar")
This is the error I get:
(Rollbax) Trying to report an exception but the :rollbax application has not been started
I checked the started applications and rollbax
was there. On top of that, explicitly doing
Rollbax.report_message("this should go to Rollbar")
works perfectly fine.
I guess there must be something about how the logger backends work that I’m missing. Does anyone have any hint?