User action log

Hi all,

I had been searching and reading for user action logging in Rails 3 and didn’t came out with something that looks like the way to take for sure.

Does anyone know a gem or have any recommendation about the best way to do this?

The idea is to log the user, date and time information, the controller and action in almost all the actions.


you can do it by yourself.. just create before_filter, place into your application controller and store controller_name and action or any other values

assume you have some db table with user logging

class ApplicationController < ActionController::Base

  before_filter :log_user


  def log_user
      :user => current_user,
      :controller_name = controller_name,
      :action => action_name


you can store your params as well (eg. serialize into YAML)


Thanks Tom, thats the approach I had in mind but didn’t know for sure if there was already something or if it was a good way to go.

Will follow your indications.