Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix dev initializer logs not going to stdout #46170

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Commits on Sep 28, 2023

  1. Fix dev initializer logs not going to stdout

    Previously, the Rails server and console commands would broadcast logs
    to STDOUT if the Rails.logger was not already logging to STDOUT/STDERR.
    However, the broadcast was setup after initialization had finished, so
    some logs may not have been broadcast. More specifically, anything
    logged during initialization after the :initialize_logger initializer
    would not be logged to STDOUT.
    
    This is an issue especially because of how common it is for deprecation
    warnings to be logged during initialization. Very important deprecation
    warnings such as :warn_if_autoloaded in Rails 6/6.1 would not be logged
    to STDOUT even though application logs after initialization would.
    
    This is very confusing because users most likely assumed that
    development logs were identical between STDOUT and log/development.log
    when they were actually not.
    
    This commit fixes the issue by broadcasting when the logger is set up,
    so that STDOUT and log/development.log will both log everything.
    skipkayhil committed Sep 28, 2023
    Configuration menu
    Copy the full SHA
    bf9f76b View commit details
    Browse the repository at this point in the history