Sha256: 01b4567cebbac021eaa5b1b2763f58c7d9109678d0408e1b359a9a1b9a819c55

Contents?: true

Size: 753 Bytes

Versions: 10

Compression:

Stored size: 753 Bytes

Contents

class Logster::Middleware::DebugExceptions < ActionDispatch::DebugExceptions
  private

  def log_error(request_or_env, wrapper)
    env =
      if Rails::VERSION::MAJOR > 4
        request_or_env.env
      else
        request_or_env
      end

    exception = wrapper.exception

    Logster.config.current_context.call(env) do
      location = exception.backtrace[0]
      exception_string = exception.to_s

      Logster.logger.add_with_opts(::Logger::Severity::FATAL,
                        exception.class.to_s << " (" << exception_string << ")\n#{location}",
                        "web-exception",
                        backtrace: exception.backtrace.join("\n"),
                        env: env)
    end

  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
logster-2.1.2 lib/logster/middleware/debug_exceptions.rb
logster-2.1.0 lib/logster/middleware/debug_exceptions.rb
logster-2.0.1 lib/logster/middleware/debug_exceptions.rb
logster-2.0.0.pre lib/logster/middleware/debug_exceptions.rb
logster-1.4.0.pre lib/logster/middleware/debug_exceptions.rb
logster-1.3.4 lib/logster/middleware/debug_exceptions.rb
logster-1.3.3 lib/logster/middleware/debug_exceptions.rb
logster-1.3.2 lib/logster/middleware/debug_exceptions.rb
logster-1.3.0 lib/logster/middleware/debug_exceptions.rb
logster-1.3.pre lib/logster/middleware/debug_exceptions.rb