96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
|
# File 'lib/appmospheres_audit.rb', line 96
def enable_action_tracking
around_filter do |controller, action|
begin
begin
filtered_actions = AppmospheresAudit.filter_actions || []
unless filtered_actions.include?(controller.action_name.to_sym) || filtered_actions.include?(controller.action_name)
filtered_params = Rails.application.config.filter_parameters + (AppmospheresAudit.filter_parameters || [])
EventLog.create!(:event_type => 'controller', :action => controller.request.parameters[:action],
:payload => controller.request.parameters.except(*filtered_params).to_yaml)
end
rescue
Rails.logger.warn "tracked #{controller.request.parameters.inspect}" rescue nil
end
action.call
rescue Exception => e
log_exception(e)
raise end
end
end
|