如何将Heroku日志保存到文本文件 [英] How to save Heroku logs to text file

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

问题描述

我在使用Heroku登录时遇到问题。当我想看日志时,有时候我错过了几行。如何将Heroku服务器日志保存到file.txt或任何其他文件?解析方案

您可以试试这个:

>

heroku日志-n number_of_lines --app application_name>> file_name



>> 运算符会将命令输出追加到一个文件: file_name



然而,heroku保留最后的1500行整合日志。如果您想要保留超过1,500行用于长期存储,搜索,警报,过滤和其他处理,您可以使用登录插件提供商

I am having a problem with logs in Heroku. When I want to look at the logs, sometimes I have missed a few lines. How can I save Heroku server logs to file.txt, or any other file?

解决方案

You can try this:

heroku logs -n number_of_lines --app application_name >> file_name

>> operator will appends the command output to the end of a file : file_name

however, heroku keeps the last 1,500 lines of consolidated logs. If you’d like to persist more than 1,500 lines for long-term storage, search, alerting, filtering and other processing, you can use logging Add-on Providers.

这篇关于如何将Heroku日志保存到文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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