从Rails日志文件中提取错误信息 [英] extracting error information from rails log files

查看:139
本文介绍了从Rails日志文件中提取错误信息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在5个不同的Rails项目上进行开发,还进行了一些重构(从较旧的Rails版本升级到2.3)-从日志文件中提取错误信息的最佳方法是什么,因此我可以看到所有的折旧警告,运行时错误等等,这样我就可以改善代码库了吗?

i am developing on 5 different rails projects, plus also refactoring some (moving from older rails versions to 2.3) - what is the best way to extract the error information from the logfiles, so i can see all the depreciation warnings, runtime errors and so on, so i can work on improving the codebase?

您是否可以推荐一些服务或库,这些服务或库实际上对Rails日志文件的解析有帮助?

are there any services or libraries out there you can recommend, that actually help with rails logfile parsing?

推荐答案

了解有关grep linux命令的信息.

Read about grep linux command.

http://www.cyberciti.biz /faq/howto-use-grep-command-in-linux-unix/

我不知道Rails中的错误日志格式是什么,但是我在警告或错误的每一行中都包含警告"或错误"字样.

I don't know what error log format is in Rails, but I guest every row with warning or error contain "warning" or "error" word.

然后是这样的:

grep -E "error|warning" logfile.txt

关于机器人错误和警告

grep "error" logfile.txt

错误

grep "warning" logfile.txt

警告

,如果您想实时查看新的错误和警告,请尝试

and if you want to see new errors and warnings in real time, try this

tail -f logfile.txt | grep -E "error|warning"

tail -f logfile.txt | grep "error"

tail -f logfile.txt | grep "warning"

希望我能为您提供帮助;)并且希望我对Rails中的日志格式没有错

Hope I could help you ;) and I hope that I'm not wrong about logs format in Rails

这篇关于从Rails日志文件中提取错误信息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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