ActiveRecord vs logger


#1

Appendix B.1 of the Agile book says you can configure as follows:

B.1 Active Record Configuration

ActiveRecord::Base.logger =logger

Accepts a logger object. This is used internally to record database

activity. It is also available to applications that want to log
activity.

Yet, as far as I know, there is no way to use logger.info and friends
within a model. Is
there? Or is this simply a way to redirect the internal logging

that goes on?

W Fred


#2

Use RAILS_DEFAULT_LOGGER if you want your log messages in the default
log files. You can use this anyplace in a Rails app (plugins are a great
place!).

–steve