RedHatInsights / insights-api-common-rails

Header, Encryption, RBAC, Serialization, Pagination and other common behavior for Insights microservices built with Rails
Apache License 2.0
3 stars 25 forks source link

Logging doesn't cover everything written #30

Open Fryguy opened 5 years ago

Fryguy commented 5 years ago

Here's an example of output from one of our containers:

{"@timestamp":"2019-01-29T15:41:30.208138 ","hostname":"topological-inventory-api-74-wt7xn","pid":10,"tid":"404f5c","level":"debug","message":"   (0.3ms)  BEGIN"}
{"@timestamp":"2019-01-29T15:41:30.208869 ","hostname":"topological-inventory-api-74-wt7xn","pid":10,"tid":"404f5c","level":"debug","message":"   (0.3ms)  COMMIT"}
`/` is not writable.
Bundler will use `/tmp/bundler/home/unknown' as your home directory temporarily.
=> Booting Puma
=> Rails 5.2.2 application starting in production 
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.12.0 (ruby 2.4.5-p335), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: production
* Listening on tcp://0.0.0.0:3000
Use Ctrl-C to stop
{"@timestamp":"2019-01-29T15:41:48.209463 ","hostname":"topological-inventory-api-74-wt7xn","pid":15,"tid":"2ec4ef4","level":"info","message":"Started GET \"/metrics\" for 10.128.29.111 at 2019-01-29 15:41:48 +0000"}
{"@timestamp":"2019-01-29T15:42:03.202977 ","hostname":"topological-inventory-api-74-wt7xn","pid":15,"tid":"2ec4da0","level":"info","message":"Started GET \"/metrics\" for 10.128.29.111 at 2019-01-29 15:42:03 +0000"}
Fryguy commented 5 years ago

cc @carbonin

carbonin commented 5 years ago

I don't think this is solved in manageiq either:

16:18:41:~/Source/manageiq (master)$ CONTAINER=true be rails s
=> Booting Puma
=> Rails 5.0.7.1 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
{"@timestamp":"2019-01-29T16:19:30.589083 ","hostname":"localhost.localdomain","pid":22227,"tid":"2b0a95de0f60","level":"debug","message":"PostgreSQLAdapter#log_after_checkout, connection_pool: size: 100, connections: 1, in use: 1, waiting_in_queue: 0"}

I've been looking into how to set the logger for puma before the app configuration, but haven't had much luck. Any ideas?