Skip to content

Commit

Permalink
Add lograge to tidy up logging when rendering actions
Browse files Browse the repository at this point in the history
  • Loading branch information
malparty committed Nov 10, 2023
1 parent aeb25a9 commit b947e32
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .template/spec/base/config/application_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@
expect(subject).to contain('config.active_job.queue_name_prefix = Rails.env')
end

it 'enables lograge' do
expect(subject).to contain('config.lograge.enabled = true')
end

it 'configures the middleware for rack deflater' do
expect(subject).to contain('config.middleware.use Rack::Deflater')
end
Expand Down
1 change: 1 addition & 0 deletions Gemfile.tt
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ gem 'pagy' # A pagination gem that is very light and fast
gem 'discard' # Soft deletes for ActiveRecord
gem 'sidekiq' # background processing for Ruby
gem 'bootsnap', require: false # Reduces boot times through caching; required in config/boot.rb
gem 'lograge' # Taming Rails' Default Request Logging
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
# gem 'jbuilder' # Build JSON APIs with ease
# gem 'redis' # Use Redis adapter to run Action Cable in production
Expand Down
3 changes: 3 additions & 0 deletions config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
# Prefix the queue name of all jobs with Rails ENV
config.active_job.queue_name_prefix = Rails.env
# Single line logs for Action Rendering
config.lograge.enabled = true
# Compress the responses to reduce the size of html/json controller responses.
config.middleware.use Rack::Deflater
RUBY
Expand Down

0 comments on commit b947e32

Please sign in to comment.