I just spent five minutes figuring out how to log from a model class in Rails (or any class that isn’t a controller or view). Y’see, there is no “logger” method on an ActiveRecord for instance. Once again Robby to the rescue with an oblique mention of the RAILS_DEFAULT_LOGGER global. I love that guy.
Related: I wonder what Jamis circa ‘05 was talking about when he said:
Note: logging is a bad example here, because Rails already has very good support for logging. Furthermore, recent Rails releases support a service keyword, for declaring and using system-global services in the same manner described here.
Huh? Service keyword?

Robby Russell | 05-Aug-07 at 11:29 am | Permalink
re: service keyword
I’m not sure what he was talking about either.
However, The RAILS_DEFAULT_LOGGER is quite handy sometimes.