class LogjamAgent::Railtie

Public Instance Methods

log_error(request, wrapper) click to toggle source
# File lib/logjam_agent/railtie.rb, line 127
def log_error(request, wrapper)
  logger = logger(request)
  return unless logger

  exception = wrapper.exception

  trace = wrapper.application_trace
  trace = wrapper.framework_trace if trace.empty?

  ActiveSupport::Deprecation.silence do
    parts = [ "#{exception.class} (#{exception.message})" ]
    parts.concat exception.annoted_source_code if exception.respond_to?(:annoted_source_code)
    parts.concat trace
    logger.fatal parts.join("\n  ")
  end
end
logjam_log_path(app) click to toggle source
# File lib/logjam_agent/railtie.rb, line 11
def logjam_log_path(app)
  paths = app.config.paths
  (Rails::VERSION::STRING < "3.1" ? paths.log.to_a : paths['log']).first.to_s
end