0

My Rails app is on Heroku and needs access to S3. As such, I have a .env file at the root of my directory with the AWS authentication bits. Simply running rails s will not use the env file, so I need to test my server with heroku local. However, this will not spit out any of the standard rails output. I did try heroku logs and heroku logs -t.

My procfile:

web: bundle exec puma -t 5:5 -p ${PORT:-3000} -e ${RACK_ENV:-development}

My env file:

RACK_ENV=development
PORT=3000
AWS_ACCESS_KEY_ID=MYSECRETACCESSKEYID
AWS_SECRET_ACCESS_KEY=mySECRETaccessKEY
S3_BUCKET=my-bucket
AWS_REGION=us-east-1

After running heroku local:

[OKAY] Loaded ENV .env File as KEY=VALUE Format
1:33:45 PM web.1 |  Ignoring http_parser.rb-0.6.0 because its extensions are not built. Try: gem pristine http_parser.rb --version 0.6.0
1:33:46 PM web.1 |  Puma starting in single mode...
1:33:46 PM web.1 |  * Version 4.3.5 (ruby 2.6.3-p62), codename: Code Name
1:33:46 PM web.1 |  * Min threads: 5, max threads: 5
1:33:46 PM web.1 |  * Environment: development
1:33:48 PM web.1 |  * Listening on tcp://0.0.0.0:3000
1:33:48 PM web.1 |  Use Ctrl-C to stop

Expected results: whenever I make a request to the endpoint, I expect it to log the endpoint, the SQL commands, and the errors, like it usually does.

Jericho
  • 115
  • 1
  • 2
  • 11
  • 2
    Sorry for such a dummy recommendation, but did you checked your log level inside config/environments/ENV_NAME? – Andrés Aug 22 '20 at 17:53
  • No problem! They seem to be fine. `development.rb` doesn't have anything mentioning logs, so I set it to `config.log_level = :debug`, but still not output. `production.rb` was already set at debug. – Jericho Aug 23 '20 at 11:31

1 Answers1

0

I think I figured it out. Since we are not calling rails s directly, (my procfile is calling bundle exec puma), I looked on StackOverflow for similar questions involving puma and found this.

I needed to open a second terminal and run tail -f logs/development.log.

Jericho
  • 115
  • 1
  • 2
  • 11