0

I have a Rails app with a MongoDB datastore. As a result, the models don't inherit from ActiveRecord::Base. When I try to add logging to the model, like so

logger.info "Debug application" 

rails complains that logger doesn't exist, which makes sense. How do I add the logger functionality back, short of inheriting from ActiveRecord::Base?

1 Answer 1

1

Use Rails.logger.info instead of logger.info

from http://jasonseifer.com/2009/08/10/using-the-rails-logger-outside-of-models-and-controllers

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.