class Tablexi::Logger::Railtie

Public Instance Methods

setup_lograge(app) click to toggle source
# File lib/tablexi/logger/railtie.rb, line 10
def setup_lograge(app)
  # since Lograge's after_initialize isn't guaranteed to run before this one
  # we need to make sure the setup occurs before we check lograge.logger
  Lograge.setup(app)

  return unless Lograge::RequestLogSubscriber.new.logger == Rails.logger

  # We need to preserve lograge file format integrity if lograge is using
  # Rails.logger - presumably error tracking services will report the errors
  # so they aren't swallowed silently.
  null_logger = ::Logger.new(File.open(File::NULL, "w"))
  Tablexi.bare_logger = null_logger
end