hcb
hcb copied to clipboard
[Logging] Capture all logs
We have two problems:
-
Rails.loggeris not sent anywhere. We want it in$stdoutand AppSignal https://docs.appsignal.com/logging/integrations/ruby.html#rails-logger -
Rails.loggertheoretically is supposed to go to$stdout- https://github.com/hackclub/bank/blob/11254c8be96b81f8b7c1a552714c6394dffb5353/config/environments/production.rb#L104-L108
- and we have
RAILS_LOG_TO_STDOUT=enabledin production - However, both Heroku and
docker logs <container id>don't show any logs from the Rails app. Heroku has logs from the postgres and router, but none from Rails.
At the moment, the important stuff show up in AppSignal, so not a huge issue.
The main reason why I want logs to go to stdout (in addition to AppSignal) is that it's easier to view/debug if you're on Hatchbox or in the server.
If there are any significant performant deteriment trying to log to stdout, then maybe we don't move forward on this.
I think logs should now be on:
journalctl --user --unit=hcb-* --follow
Though there's some sort of delay?
Everything is also on Appsignal: