Forum: Ruby on Rails ActiveRecord vs logger

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
E6dd9cedee99f9d02e5f87d80ee0e681?d=identicon&s=25 Warren Seltzer (Guest)
on 2006-05-17 18:53
(Received via mailing list)
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
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 steve ross (Guest)
on 2006-05-17 22:03
(Received via mailing list)
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
This topic is locked and can not be replied to.