通过HTTP在Web服务器上尾随文本文件 [英] Tail a text file on a web server via HTTP
问题描述
寻找有关如何解决以下问题的输入。我的ColdFusion 9应用程序有一个简单的记录器将文本写入文件。在我的dev机器上,文件是本地的,所以我可以使用'tail -f'或CFB的TailView来观看它。我想要一个工具,当它部署在生产服务器上观看。捕获:生产位于不允许RDS文件访问的共享CF托管提供商或目录 - 观察者网关。我想知道一个具有元刷新标记的页面,或者如果我想获得更多的想法,AJAXY的效果相同。想法?
Looking for input on how to solve the following problem. My ColdFusion 9 app has a simple logger that writes text to a file. On my dev machine, the file is local so I can use either 'tail -f' or CFB's TailView to watch it. I'd like a tool to watch it when it's deployed on the production server. The catch: production is at a shared CF hosting provider which doesn't allow RDS file access or a directory-watcher gateway. I'm wondering about a page with a meta refresh tag or if I want to get more fancy, something AJAXy to the same effect. Thoughts? Any tools that already exist for this?
我可以尝试这个,但希望有一些东西在那里更完整:通过http 跟踪日志文件
I may experiment with this but am hoping there is something out there "more complete" : following a log file over http
推荐答案
您可以使用以下PHP脚本:
You can you the following PHP script:
<?php
header("Content-Type: text/plain");
set_time_limit(0);
passthru("tail -F -n +0 log.txt");
?>
这篇关于通过HTTP在Web服务器上尾随文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!