Hello there,
Can you explain how do you capture Rails logs?
My specific question is actually a little bit different, I’ve added logstasher gem, and assuming that in Docker world everything should just go to STDOUT, I set up logstasher in that way.
The problem is that every line in the logs is prepended with App #{pid} stdout:
and I’m sure Kibana won’t parse them right.
Here is an example:
2017-09-05T20:54:45.857Z [nex-backend-dev-web 54e485089573]: App 315 stdout: {"method":"HEAD","path":"/","format":"json","controller":"welcome","action":"index","status":200,"duration":4.9,"view":4.44,"db":0.0,"ip":"54.159.126.21","route":"welcome#index","request_id":"5f695a02-0ab8-4108-adaf-45b018f63352","source":"nexhealth.staging.rails","tags":["request"],"@timestamp":"2017-09-05T20:54:45.283Z","@version":"1"}
Should I just log to file and expect logs to get shipped to our ELK instance?
Also, adding some technical info to the support pages (I’m talking about https://www.aptible.com/documentation/enclave/tutorials/logging-setup/elk-stack.html) would be very helpful.
Thanks!