A connection pool leak in a Rails application was traced back to the logger holding onto a database connection due to the accidental passing of an ActiveRecord relation, which evaluated within a thread causing connection exhaustion. The resolution involved modifying the logging to only include primitive values and highlighted the importance of careful logging practices and monitoring connection usage.
Puts debugging is a favored technique for many Rails developers, and this article introduces a custom gem called `dbg-rb`, inspired by Rust's `dbg!` macro. It provides enhanced output for debugging by showing variable names, file locations, and line numbers, making the process more efficient without cluttering the Gemfile. Tips for integrating `dbg-rb` into Rails without adding it to the Gemfile are also discussed.