Making the Most of Your Logs in Rails
Rails logs through Rails.logger — on Rails 8.1, a BroadcastLogger that writes tagged lines to STDOUT in production and to log/development.log in development. Six levels exist: debug, info, warn, error, fatal, and unknown; production defaults to info via RAILS_LOG_LEVEL. Good log messages are descriptive, carry context like request IDs, and become structured JSON when machines read them.