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.
F978b6d4844d1a8917bc76f9e03bfc0e?d=identicon&s=25 mariek (Guest)
on 2008-11-27 17: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.
2d8132658d56e51f19ace1c68e48b6aa?d=identicon&s=25 Thorsten Mueller (thorsten)
on 2008-11-27 17: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"
9d12e24c0a3aebe28b58682d517acdfb?d=identicon&s=25 ybernet@msn.com (Guest)
on 2008-11-27 17: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
F978b6d4844d1a8917bc76f9e03bfc0e?d=identicon&s=25 mariek (Guest)
on 2008-11-28 10:35
(Received via mailing list)
thanks a lot guys
This topic is locked and can not be replied to.