Sha256: 1fd3e1c6910fd6e96320e25d45845cf1f4eb60529a17034540ad316afe6778d6

Contents?: true

Size: 727 Bytes

Versions: 8

Compression:

Stored size: 727 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

8 entries across 8 versions & 1 rubygems

Version Path
logster-2.3.1 lib/logster/middleware/debug_exceptions.rb
logster-2.3.0 lib/logster/middleware/debug_exceptions.rb
logster-2.2.0 lib/logster/middleware/debug_exceptions.rb
logster-2.1.1 lib/logster/middleware/debug_exceptions.rb
logster-1.3.1 lib/logster/middleware/debug_exceptions.rb
logster-1.2.11 lib/logster/middleware/debug_exceptions.rb
logster-1.2.9 lib/logster/middleware/debug_exceptions.rb
logster-1.2.8 lib/logster/middleware/debug_exceptions.rb