pauldowman / better_logging

(Old/dead) A Rails plugin that improves the log format.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

More information regarding usage in controllers/models

BunnyBacon opened this issue · comments

Hello!

Commenting quickly, I used the plugin installation. Then tried to catch my exception:

log.error "oops", e

This gave me undefined method log error. Where am I supposed to define this, and how?

Thanks for catching this, there was a typo in the docs, fixed in 07ba41e.

It should be logger.error (or Rails.logger.error if you're in a class that doesn't have the method logger defined). That's the standard way to get the logger object in Rails (it just happens to be an enhanced version of the logger if you're using this plugin).