No commit activity in last 3 years
No release in over 3 years
ActiveJob logging for Lograge
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 3.5

Runtime

 Project Readme

A Lograge extensions for Rails

Rails middleware for Lograge with support to log exceptions ActiveJobs.

Logs:

  • Exceptions occurred during running jobs on ActiveJob (Rails 4.2+)

Installation

Add line to your application's Gemfile:

gem 'rails' # minimal version is 4.0
gem 'lograge'
gem 'lograge_active_job'

Now, gem should catch all exceptions thrown by ActiveJobs and save them to Lograge.

Please remember about Lograge configuration.

Custom setup

You can configure additional fields, which will be logged for every exception.

# config/initializers/lograge.rb
Rails.configure do |config|
  config.rails_lograge_middleware.custom_options = lambda do |exception, job|
    # == Parameters:
    # exception:
    #   Occurred exception
    # job:
    #   ActiveJob instance, which crashed
    #
    # == Returns:
    # Hash with elements to write to log
    #
    {
	# Your custom options
    }
  end
end

References:

Rack::Request