I\'m interested in sending all Rails application logging to a database (MySQL or MongoDB) either in addition to or instead of to a log file. There are a few reasons, most of
If you want to change the default logging behavior, simply create a custom logger object that respond to all the Rails logger method:
http://github.com/rails/rails/blob/9d7aae710384fb5f04129c35b86c5ea5fb9d83a9/activesupport/lib/active_support/buffered_logger.rb
Because it's your logger, you can decide to implement your personal logic. You can write to the database, to the standard output of whenever you want.
Then, replace the default logger for every base class you want to customize.
ActiveRecord::Base.logger = YouLogger.new
You can easily create an initializer file called logger.rb and write there all your custom configurations. In this way, the logger will be immediately replaced on Rails startup.