You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While I can appreciate the author's disdain of Ruby error logging, I kind of rely on the default Rails log output when building and debugging my app. I've added lots of custom, colorized output that helps me follow requests to third party APIs, for example.
Is there a config setting I can maybe set to disable the console logging and just go back to Rails default log output?
Cursor came up with an initializer that gets close, but it doesn't show the initial request along with params that were present, or individual views/partial renders along with Duration/GC times. It will still show Falcon's log for the request after all the ActiveRecord reporting is complete, however:
ifRails.env.development?Rails.application.configuredo# Set up standard Rails logging before Falcon takes overconfig.logger=ActiveSupport::Logger.new($stdout)config.log_level=:debugconfig.log_formatter=ActiveSupport::Logger::SimpleFormatter.new# This runs after Rails is fully initialized but before requests startconfig.to_preparedo# Only override if Rails.logger exists and we're not in the middle of startupifdefined?(Rails.logger) && Rails.logger# Create a new standard Rails loggerlogger=ActiveSupport::Logger.new($stdout)logger.level=:debuglogger.formatter=ActiveSupport::Logger::SimpleFormatter.new# Replace Rails.logger with our standard loggerRails.logger=logger# Update Rails component loggers to use the same loggerActiveRecord::Base.logger=loggerifdefined?(ActiveRecord::Base)ActionController::Base.logger=loggerifdefined?(ActionController::Base)ActionMailer::Base.logger=loggerifdefined?(ActionMailer::Base)ActiveJob::Base.logger=loggerifdefined?(ActiveJob::Base)# Update log subscribers to use our loggerActiveSupport::LogSubscriber.log_subscribers.eachdo |subscriber|
subscriber.logger=loggerifsubscriber.respond_to?(:logger=)endendendendend
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
While I can appreciate the author's disdain of Ruby error logging, I kind of rely on the default Rails log output when building and debugging my app. I've added lots of custom, colorized output that helps me follow requests to third party APIs, for example.
Is there a config setting I can maybe set to disable the
consolelogging and just go back to Rails default log output?Cursor came up with an initializer that gets close, but it doesn't show the initial request along with params that were present, or individual views/partial renders along with Duration/GC times. It will still show Falcon's log for the request after all the ActiveRecord reporting is complete, however:
Beta Was this translation helpful? Give feedback.
All reactions