2016-03-03 18:33:59 +01:00
|
|
|
if LogStasher.enabled
|
|
|
|
LogStasher.add_custom_fields do |fields|
|
2017-08-28 11:18:38 +02:00
|
|
|
fields[:type] = "tps"
|
2016-03-03 18:33:59 +01:00
|
|
|
end
|
2018-01-17 14:40:31 +01:00
|
|
|
|
|
|
|
LogStasher.watch('process_action.action_controller') do |name, start, finish, id, payload, store|
|
|
|
|
store[:user_agent] = payload[:user_agent]
|
|
|
|
store[:browser] = payload[:browser]
|
|
|
|
store[:browser_version] = payload[:browser_version]
|
|
|
|
store[:platform] = payload[:platform]
|
|
|
|
|
|
|
|
store[:current_user_roles] = payload[:current_user_roles]
|
|
|
|
|
|
|
|
if payload[:current_user].present?
|
|
|
|
store[:current_user_id] = payload[:current_user][:id]
|
|
|
|
store[:current_user_email] = payload[:current_user][:email]
|
|
|
|
end
|
|
|
|
end
|
2016-03-03 18:33:59 +01:00
|
|
|
end
|