Browse Source

filter out ActionView::Base Rendered internal gem

main
pvincent 2 years ago
parent
commit
b5074e2109
  1. 2
      app/controllers/main_controller.rb
  2. 9
      config/environments/development.rb

2
app/controllers/main_controller.rb

@ -9,7 +9,7 @@ class MainController < ApplicationController
logger.warn "a warning" logger.warn "a warning"
logger.error "an error" logger.error "an error"
# raise "this is an error"
raise "this is an error"
sleep 3 sleep 3
end end
end end

9
config/environments/development.rb

@ -69,5 +69,12 @@ Rails.application.configure do
# config.action_cable.disable_request_forgery_protection = true # config.action_cable.disable_request_forgery_protection = true
# Semantic Logger in console log only! # Semantic Logger in console log only!
config.semantic_logger.add_appender(io: $stdout, formatter: BasicFormatter.new)
config.semantic_logger.add_appender(
io: $stdout,
formatter: BasicFormatter.new,
filter: ->log {
return true if log.name != "ActionView::Base"
log.message.exclude?("Rendered /") && log.message.exclude?("Rendered layout /")
},
)
end end
Loading…
Cancel
Save