fix log_events method to work with rails 4.1+