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.
When you’re deployed on Enclave and set up an Elasticsearch Log Drain, by default we send your logs directly to Elasticsearch. This means Kibana will likely show you the JSON as text.
To fix this, we can enable an Ingest Piepline if you’d like, where you can perform the JSON parsing. This is support-request-only at this time, so feel free to contact support if you’d like to set that up.
(of course, you could also run Logstash yourself and route your logs there, but that’s more brittle, difficult, and expensive)
Thomas, thanks a lot for your thorough answer, looks like I got confused because usually Rails app servers, such as Unicorn or Puma, they write logs to log/ directory, not to STDOUT. Actually, even after looking carefully at https://github.com/phusion/passenger-docker I still fail to see where they redirect logging to STDOUT, andI had that idea that the image is made by Aptible and you just tweak some logging settings…
Thanks a lot for clearing things up!
Also thanks for the remark about log parsing, that’s something I totally missed. You know, when you don’t how things work, you tend to expect them to work automagically
So, I will have to deal with Passenger first, and when the logs look fine, we can return to that Ingest Piepline subject.