You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using rails 4.2.3 and the latest version of logstasher (v1.0.1). What am I missing?
The text was updated successfully, but these errors were encountered:
cyndefromva
changed the title
Custom fields are not being added to Controller Request
Custom fields are not being added to Request statements in logstasher log
Oct 19, 2016
I have added a config/logstasher.yml file to my project to enable logstasher. Here is its contents:
controller_enabled: true
mailer_enabled: false
record_enabled: false
job_enabled: true
view_enabled: true
suppress_app_log: false
development:
enabled: true
record_enabled: true
production:
enabled: true
mailer_enabled: true
view_enabled: false
suppress_app_log: true
And the following initializer (config/initializers/logstasher.rb):
LogStasher.add_custom_fields do |fields|
fields[:user_login] = "somevalue"
fields[:user_email] = "somevalue"
end
LogStasher.add_custom_fields_to_request_context do |fields|
fields[:user_login] = "somevalue"
fields[:user_email] = "somevalue"
end
As you can see I have added two customized fields (user_login and user_email); and both appear in the logstasher log file for view statements:
{"identifier":"people/in_work.html.erb","layout":null,"name":"render_template.action_view","transaction_id":"6488c45585e6c0f95da8","duration":1124.35,"request_id":"5e9f149b-029d-45da-8082-26e1075aa08f","user_login":"somevalue","user_email":"somevalue","source":"unknown","tags":[],"@timestamp":"2016-10-19T13:16:53Z","@Version":"1"}
However, they do not appear in request statements:
{"method":"GET","path":"/people/in_work","format":"/","controller":"people","action":"in_work","status":200,"duration":1182.23,"view":684.49,"db":0.0,"source":"unknown","tags":["request"],"@timestamp":"2016-10-19T13:16:53Z","@Version":"1"}
I am using rails 4.2.3 and the latest version of logstasher (v1.0.1). What am I missing?
The text was updated successfully, but these errors were encountered: