heroku - 如何查看所有日志 [英] heroku - how to see all the logs

查看:39
本文介绍了heroku - 如何查看所有日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在 heroku 上有一个小应用程序.每当我想查看日志时,我都会转到命令行并执行

I have a small app on heroku. Whenever I want to see the logs I go to the command line and do

heroku logs

那只显示了大约 100 行.有没有办法在 heroku 上查看我们应用程序的完整日志?

That only shows me about 100 lines. Is there not a way to see complete logs for our application on heroku?

推荐答案

更新(感谢 dawmail333):

heroku logs -n 1500

或者,实时跟踪日志

heroku logs -t 

Heroku 日志文档

如果你需要超过几千行你可以使用heroku的Syslog Drains

If you need more than a few thousand lines you can Use heroku's Syslog Drains

或者(旧方法):

$ heroku run rails c
File.open('log/production.log', 'r').each_line { |line| puts line }

这篇关于heroku - 如何查看所有日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆