Rails Logger

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.

not sure if that works, but in many cases
where logger.info doesn’t work (like in rspec specs)
you can use:

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:


thanks a lot guys

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs