Here is a project I'm working on: https://github.com/homanchou/the_drawing_challenge
I'm having trouble seeing any db queries in the server logs on heroku or even locally in the terminal when running Puma with Foreman.
All I see are asset or web requests
21:54:34 web.1 | started with pid 54784
21:54:35 web.1 | [54784] Puma starting in cluster mode...
21:54:35 web.1 | [54784] * Version 2.10.2 (ruby 2.1.5-p273), codename: Robots on Comets
21:54:35 web.1 | [54784] * Min threads: 1, max threads: 4
21:54:35 web.1 | [54784] * Environment: development
21:54:35 web.1 | [54784] * Process workers: 2
21:54:35 web.1 | [54784] * Preloading application
21:54:36 web.1 | [54784] * Listening on tcp://0.0.0.0:5000
21:54:36 web.1 | [54784] Use Ctrl-C to stop
21:54:36 web.1 | [54784] - Worker 0 (pid: 54785) booted, phase: 0
21:54:36 web.1 | [54784] - Worker 1 (pid: 54786) booted, phase: 0
21:54:43 web.1 | [54785] 127.0.0.1 - - [02/Apr/2015:21:54:43 -0700] "GET / HTTP/1.1" 200 - 0.3120
21:54:43 web.1 | [54785] 127.0.0.1 - - [02/Apr/2015:21:54:43 -0700] "GET /logo_header.png HTTP/1.1" 304 - 0.0079
21:54:45 web.1 | [54785] 127.0.0.1 - - [02/Apr/2015:21:54:45 -0700] "GET /challenges/8 HTTP/1.1" 200 - 0.0443
21:54:45 web.1 | [54785] 127.0.0.1 - - [02/Apr/2015:21:54:45 -0700] "GET /logo_header.png HTTP/1.1" 304 - 0.0067
I had to add another line to the Procfile log: tail -f -n 0 log/development.log
to see logs or errors in stdout of foreman start
like I normally do, but that only works locally and not on heroku unless I want to scale up a process for that tailing.
In my other rails project I can see the db queries fine, even on heroku I can see the db queries in the log:
2015-04-03T03:46:40.052067+00:00 app[web.1]: Started GET "/api/notifications/unread_count" for 97.93.34.8 at 2015-04-03 03:46:40 +0000
2015-04-03T03:46:40.070865+00:00 app[web.1]: Merchant Load (2.7ms) SELECT "merchants".* FROM "merchants" WHERE "merchants"."id" = $1 ORDER BY "merchants"."id" ASC LIMIT 1 [["id", 7502]]
2015-04-03T03:46:40.085454+00:00 app[web.1]: SQL (2.3ms) UPDATE "merchants" SET "updated_at" = '2015-04-03 03:46:40.074442', "last_active_at" = '2015-04-03 03:46:40.074442' WHERE "merchants"."id" = $1 [["id", 7502]]
2015-04-03T03:46:40.101382+00:00 app[web.1]: (2.3ms) SELECT COUNT(*) FROM "notifications" WHERE "notifications"."merchant_id" = $1 AND "notifications"."state" = $2 [["merchant_id", 7502], ["state", "unread"]]
2015-04-03T03:46:40.058083+00:00 app[web.1]: Processing by NotificationsController#unread_count as JSON
2015-04-03T03:46:40.073916+00:00 app[web.1]: (1.0ms) BEGIN
2015-04-03T03:46:40.093737+00:00 app[web.1]: (7.4ms) COMMIT
2015-04-03T03:46:40.102858+00:00 app[web.1]: Completed 200 OK in 45ms (Views: 0.2ms | ActiveRecord: 15.6ms)
I tried comparing the two and even copying over some environment configurations but I still can't figure it out. I've tried setting config.log_level = :debug on the production environment. I can see db queries in the ruby console, but not the heroku or local puma stdout in the terminal. What am I missing?