Location of the Heroku production.log file

I wanted to see the contents of the log of my applications on heroku.com so that I would follow the excellent advice and have all the contents of my log. However, I am curious to know where my log file is actually like this: "log / production.log" looks empty:

C:\>heroku console
Ruby console for ajpbrevx.heroku.com
>> files = Dir.glob("*")
=> ["public", "tmp", "spec", "Rakefile", "doc", "config.ru", "app", "config", "lib", "README", "Gemfile.lock", "vendor", "script", "Gemfile", "log"]
>> files = Dir.glob("log/*")
=> ["log/production.log"]
>> log_file = File.open("log/production.log", "r")
=> #<File:log/production.log>
>> log_file.each_line { |line| puts line }
=> #<File:log/production.log>
>> log_file.lstat.size
=> 0

I know that I have a complete log file, how and when:

heroku logs

everything is listed, so why doesn't log / production.log contain anything? Should I apply for a ticket with Heroku ?

Thank. Vaguely James

+5
source share
3 answers

: . , .

, - config/production.rb :

config.logger = Logger.new(STDOUT)
config.logger.level = Logger.const_get((ENV["LOG_LEVEL"] || "INFO").upcase)

, , , :

heroku logs --tail
+4

Heroku logplex. , , production.log , Heoku app codebase .

, , drain .

500 --tail , :

 heroku logs -n 500
 heroku addons:upgrade logging:expanded
 heroku logs --tail
+7

I also recommend using Loggly (find it in the Add Ons section on Heroku). I am a recent Heroku user, so I don’t know if Loggly has been added after these posts, but it is definitely a distant, more usable alternative to console piping logs.

0
source

All Articles