Help me out here; I must be missing something really obvious.
I have a Padrino app running on Heroku. In boot.rb, in the block passed to Padrino.before_load, I have the following lines:
Padrino::Logger::Config[:production][:log_level] = :info
Padrino::Logger::Config[:production][:stream] = :stdout
And in the before block in app.rb, I have calls to logger.info scattered throughout.
This logs to standard out just fine on my development machine. But when I check my Heroku logs:
heroku logs -t -s app
…I don’t see anything (just the initial 3 lines of startup info from the Thin server).
What am I missing?
Some points of clarification in response to culix:
- Switching to
heroku logs -s appafter the app starts does not change anything for me. - I tried installing Papertrail. Which actually looks quite nice! But it still doesn’t have the log messages I’m looking for.
- That is a good question! I really did just have calls to
logger.infoin thebeforeblock. I will add more logging and check back, after I finish updating this question. - Now that you ask: my app doesn’t seem to be logging anything either when I switch to running in “production” (after changing database.rb to just point to the development DB). I think this means I’m just fundamentally configuring Padrino logging incorrectly. Thanks for asking this question!
- Latest boot.rb is committed.
- Nope—not (intentionally) messing with stdout in any way.
Obviously the first thing I should spend time investigating is #4 above; that’s what I will do now. Then, in case it yields nothing, on to #3.
Here are some simple questions just to make sure we’ve covered the basics:
Are you running
heroku logs -tbefore or after your app starts? If you’re not running that until afterward does dropping the-tswitch and runningheroku logs -s appdisplay anything?Do you have any syslog drain addons added to your app? If so do they display anything? If not, try adding one and running your app again – do any log details show up in the drain?
After deploying to heroku, if you visit your app’s website and exercise your app’s pages, does output from any other activity show up in the logs or syslog drain? i.e. are you able to confirm whether this is an issue with all logging for your app when running on heroku’s servers vs only an issue logging things in the
beforesection?When running on your local machine does your app still log to
:production, or does it log somewhere else? i.e. is your app doing the same thing locally as when it runs on a heroku machine? Did your deployed app somehow get set to run as a different Padrino logging environment?Is the latest version of your boot.rb file committed to the git repo that you’re pushing to heroku? If you execute
heroku run lson the appropriate directory can you see the file on a heroku web dyno?As a last resort, you’re not doing anything that messes with stdout, redirects output or print statements to somewhere else, or anything or the sort are you?