Sha256: b210081cf50bd65846b26ee39d2721deb5a55b4758502ce5a12d1687b77ba34e

Contents?: true

Size: 650 Bytes

Versions: 15

Compression:

Stored size: 650 Bytes

Contents

# frozen_string_literal: true

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]

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

  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
logster-2.9.0 lib/logster/middleware/debug_exceptions.rb
logster-2.8.0 lib/logster/middleware/debug_exceptions.rb
logster-2.7.1 lib/logster/middleware/debug_exceptions.rb
logster-2.7.0 lib/logster/middleware/debug_exceptions.rb
logster-2.6.3 lib/logster/middleware/debug_exceptions.rb
logster-2.6.2 lib/logster/middleware/debug_exceptions.rb
logster-2.6.1 lib/logster/middleware/debug_exceptions.rb
logster-2.6.0 lib/logster/middleware/debug_exceptions.rb
logster-2.5.1 lib/logster/middleware/debug_exceptions.rb
logster-2.5.0 lib/logster/middleware/debug_exceptions.rb
logster-2.4.2 lib/logster/middleware/debug_exceptions.rb
logster-2.4.1 lib/logster/middleware/debug_exceptions.rb
logster-2.4.0 lib/logster/middleware/debug_exceptions.rb
logster-2.3.3 lib/logster/middleware/debug_exceptions.rb
logster-2.3.2 lib/logster/middleware/debug_exceptions.rb