Enable Logging
Add simple logging to your ActiveRecord? objects.
Installation
- Install via ./script/plugin install http://svn.omdb-beta.org/plugins/enable_logging
- Generate Migration via ./script/generate enable_logging_migration add_log_entries_table
- Activate in ActionController? or ActiveRecord? via (see QuickInstall? for more details)
class MyController < ApplicationController log_changes_for MyModel, AnotherModel end class MyModel < ActiveRecord::Base enable_logging end
Dependencies
Logging the right user via ActionController? depends on the caching of rails. Therefore you need to activate caching in your environment. It is disabled by default in the development-environment. To change that, edit config/environments/development.rb and set:
config.cache_classes = true config.action_controller.perform_caching = true
Tutorials
- QuickInstall - enable logging in 2 minutes
- Tutorial - Extend the Agile Web Development with Rails Shop Application with Logging.
