Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/logging/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails rails 3中的production.log被卡住_Ruby On Rails_Logging - Fatal编程技术网

Ruby on rails rails 3中的production.log被卡住

Ruby on rails rails 3中的production.log被卡住,ruby-on-rails,logging,Ruby On Rails,Logging,我在测试服务器上遇到了一个奇怪的问题 基本上我的应用程序运行良好,但如果我检查production.log,它是由于某种原因停留在昨天,当我在应用程序上有一个错误。。。从那以后,我修复了它,再次部署,但日志仍然不会更新。从昨天晚上开始就是这样 所以如果我尝试 tail -f log/production.log 我最后看到的日志是昨天的。。。发生什么事?这太奇怪了 以下是我的日志: Started GET "/one" for xx.xx.xx.xx at 2012-06-04 09:14:3

我在测试服务器上遇到了一个奇怪的问题

基本上我的应用程序运行良好,但如果我检查production.log,它是由于某种原因停留在昨天,当我在应用程序上有一个错误。。。从那以后,我修复了它,再次部署,但日志仍然不会更新。从昨天晚上开始就是这样

所以如果我尝试

tail -f log/production.log
我最后看到的日志是昨天的。。。发生什么事?这太奇怪了

以下是我的日志:

Started GET "/one" for xx.xx.xx.xx at 2012-06-04 09:14:30 -0400
Processing by ParagraphsController#one as HTML
(0.5ms)  SELECT id FROM paragraphs WHERE length = 1
Paragraph Load (0.3ms)  SELECT "paragraphs".* FROM "paragraphs" WHERE "paragraphs"."id" = $1 LIMIT 1  [["id", 1]]
Rendered paragraphs/one.html.erb within layouts/application (0.1ms)
Completed 200 OK in 3ms (Views: 1.0ms | ActiveRecord: 0.8ms)
tail: cannot open `1' for reading: No such file or directory

非常感谢您的帮助

您的日志文件是否已旋转
tail-f
将跟随文件,而不是文件名。如果要跟随文件名,则应使用
tail-F
。(注意大写字母
F
)这样,当文件旋转时,您将获得新的日志文件,而不是盯着旧文件看。

。。即使我认为我遇到了问题,但有什么东西不能打开
1
来读取错误消息?您到底是如何运行的
tail
?您是对的,我错了:tail-f production.log 1-但是,当我键入tail-100 production.log时,我得到了相同的(除了tail错误)ls-lrt log列表上的最后一个文件是最近修改的文件。当你运行
tail-100
时,tail-100可能会解决你的问题,这意味着你只需要最后的
100
行,不要更多。