hcb icon indicating copy to clipboard operation
hcb copied to clipboard

[Logging] Capture all logs

Open garyhtou opened this issue 1 year ago • 2 comments

We have two problems:

  1. Rails.logger is not sent anywhere. We want it in $stdout and AppSignal https://docs.appsignal.com/logging/integrations/ruby.html#rails-logger
  2. Rails.logger theoretically 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=enabled in 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.

garyhtou avatar Feb 13 '25 00:02 garyhtou

At the moment, the important stuff show up in AppSignal, so not a huge issue.

garyhtou avatar Feb 13 '25 00:02 garyhtou

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.

garyhtou avatar Mar 27 '25 17:03 garyhtou

Image

I think logs should now be on:

journalctl --user --unit=hcb-* --follow

Though there's some sort of delay?

sampoder avatar Apr 08 '25 20:04 sampoder

Everything is also on Appsignal:

Image

sampoder avatar Apr 08 '25 20:04 sampoder