Rails not logging requests
I'm utterly stumped as to why I'm not able to see the Rails controller outputs in my development log. I've spent days beating my head against a wall trying to figure this out and I'm not sure what else to try.
5.2.3 app running ruby
It started with me not being able to see my app logs when running
docker logs <container-name>. However, I soon realized that I was able to see the output from
puma starting and a
shell script that ran
rake tasks that the issue might be with
To help assist with finding the issue:
- Tore down and rebuilt the docker environment, several times
- Stopped writing via
STDOUTin favor of
elastic-apm, just in case
- Reverted my
development.rbconfig back to what's generated with a
- Followed the suggestions here
However, when running the rails console via
docker exec -it <container-name>:
warn, despite the default logging level being
- I'm able to see log output when running
- After setting
Rails.logger.level = 0I'm able to see output when running
I tried setting the value explicitly as
config.log_level = :debug in
development.rb yet it still set itself to the
However, I'm still not able to see any logs when navigating the application. Any thoughts?
Ugh. I feel like the biggest schmuck but I've figured out the issue.
I went back though source-control to see what has changed recently. In addition to the
elastic-apmgem, I also added the Unleash gem.
I went to check out it's configuration and it looks like following their recommenced configuration causes logging to break. The line that was specifically causing offense was in the unleash initializer setting
config.logger = Rails.logger