Forum: Ruby on Rails Rails 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.
mariek (Guest)
on 2008-11-27 18:35
(Received via mailing list)
how to make default rails logger accessible in my custom modules,
because as I see now its available only for ActiveRecord and some
other Rails modules.
Thorsten M. (Guest)
on 2008-11-27 18:55
(Received via mailing list)
not sure if that works, but in many cases
where logger.info doesn't work (like in rspec specs)
you can use:
RAILS_DEFAULT_LOGGER.info "my text"
(Guest)
on 2008-11-27 18:56
(Received via mailing list)
I just dealt with the same problem:

from http://mikenaberezny.com/category/ruby/#rails-logger:
"From outside a controller or model, you can pass the logger instance
or access it with the constant RAILS_DEFAULT_LOGGER. "

also see:
http://www.boowebb.com/2008/01/09/writing-to-the-l...

Yoram
mariek (Guest)
on 2008-11-28 11:35
(Received via mailing list)
thanks a lot guys
This topic is locked and can not be replied to.