Closed immitev closed 8 years ago
After inspecting the code of the gem, it is likely that the method add_default_fields_to_payload
in logstasher.rb
is not called for some reason, as it is responsible for setting value for ip
, route
and request_id
. But still not clear, what could be the root cause...
i dont even see the ip field in the logs at all... on rails 4
@MarcGrimme Yup, custom_params are now logged and issue seems to be fixed in master.
A few important remarks here:
Thanks. /cc @shadabahmed
I saw some spec failures with 3.x. I can lower the gemspec back and see fix whatever breaks
We have run 0.9 in production for quite a while, so I think it's safe to lower it.
Hi, sometimes (actually quite often), a log entry is partially empty, i.e. many of its fields are null. This has been observed both in the log file logstash_development.log, and in logstash itself. I am using logstasher (0.9.0) and rails 3.2.22.2. Here is a sample problematic message (notice the "ip" and the rest of the fields are 'null'):
{"method":"GET","path":"/beta/test","format":"html","controller":"beta/test","action":"show","status":404,"duration":57.59,"view":0.71,"db":6.58,"ip":null,"route":null,"request_id":null,"hostname":null,"application":null,"environment":null,"system":null,"source":"logstasher","tags":["request"],"@timestamp":"2016-04-22T11:35:58Z","@version":"1"}
While I see many bad log entries like this, there are also many valid ones, that have all those fields filled properly. Even issuing one and the same request several times in a row (e.g. by clicking a button), leads to sometimes complete and sometimes incomplete log entries. Can't find a particular pattern, though...
Any ideas what could be the reason for this strange behaviour? Any tips for troubleshooting?