@@ 22,9 22,28 @@ LOG.formatter = Ougai::Formatters::Readable.new(
nil,
plain: !$stdout.isatty
)
+Blather.logger = LOG
+EM::Hiredis.logger = LOG
+StatsD.logger = LOG
LOG.info "Starting"
-Sentry.init
+Sentry.init do |config|
+ config.logger = LOG
+ config.breadcrumbs_logger = [:sentry_logger]
+end
+
+module SentryOugai
+ class SentryLogger
+ include Sentry::Breadcrumb::SentryLogger
+ include Singleton
+ end
+
+ def _log(severity, message=nil, ex=nil, data=nil, &block)
+ super
+ SentryLogger.instance.add_breadcrumb(severity, message || ex.to_s, &block)
+ end
+end
+LOG.extend SentryOugai
CONFIG =
Dhall::Coder