将日志文件添加到网页 [英] Tail a logfile to a web page

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

问题描述

我希望能够在网页上查看日志文件,并希望了解

选项用于动态更新日志输出而不需要

必须刷新页。基本上它的行为类似于

" tail -f some.log"。


我尝试了一个java applet来显示来自TCP流的日志输出和

它工作得很好,但后来我发现最新的MS浏览器

没有得到java支持而且我更喜欢这样做而没有制作

用户安装任何额外的插件。嗯。


有什么想法吗?

I want to be able to view log files on web page and want to know what
the options are for dynamically updating the log output without
having to refresh the page. Basically have it behave like
"tail -f some.log".

I tried a java applet to display the log output from a TCP stream and
it works nicely, but then I discovered that the latest MS browers
don''t come with java support and I prefer to do this without making
the user install any extra plugins. Hmmm.

Any ideas?

推荐答案

Dan Olson写道:
Dan Olson wrote:
我希望能够在网页上查看日志文件,并想知道动态更新日志输出的选项是什么,而无需刷新页面。基本上它的行为类似于
tail -f some.log。

我尝试了一个java applet来显示TCP流的日志输出,并且它工作得很好,但后来我发现最新的MS浏览器没有得到java支持,我更愿意这样做而不会让用户安装任何额外的插件。嗯。

任何想法?
I want to be able to view log files on web page and want to know what
the options are for dynamically updating the log output without
having to refresh the page. Basically have it behave like
"tail -f some.log".

I tried a java applet to display the log output from a TCP stream and
it works nicely, but then I discovered that the latest MS browers
don''t come with java support and I prefer to do this without making
the user install any extra plugins. Hmmm.

Any ideas?




您可以在日志文件进入浏览器时输出这些行,

在每一行之后刷新流(不关闭连接)。以递增方式显示页面的

浏览器应该重现所需的

行为。


但这是服务器端问题 - 与HTML无关。您应该在

小组中询问有关CGI或PHP的详细信息。


-

Benjamin Niemann

电子邮件:粉红色at odahoda dot de

WWW: http: //www.odahoda.de/


Dan Olson写道:
Dan Olson wrote:

我希望能够查看在网页上记录日志文件并想知道动态更新日志输出的选项是什么,而无需刷新页面。基本上它的行为类似于
tail -f some.log。

我尝试了一个java applet来显示TCP流的日志输出,并且它工作得很好,但后来我发现最新的MS浏览器没有得到java支持,我更愿意这样做而不会让用户安装任何额外的插件。嗯。

I want to be able to view log files on web page and want to know what
the options are for dynamically updating the log output without
having to refresh the page. Basically have it behave like
"tail -f some.log".

I tried a java applet to display the log output from a TCP stream and
it works nicely, but then I discovered that the latest MS browers
don''t come with java support and I prefer to do this without making
the user install any extra plugins. Hmmm.




我假设你是通过某种在外面运行的脚本从

日志文件中动态创建网页的HTML网页。


在生成的HTML文件的HEAD部分,包括

以下行:

< meta HTTP的当量= QUOT;刷新" content =" nn">

其中nn是某个整数。页面将每n秒刷新一次。


请参阅< URL:http://cad.chp.ca.gov/>。中间框架有nn = 30.


-


David E. Ross

< URL: http://www.rossde.com/>


我使用Mozilla作为我的Web浏览器,因为我想要一个符合Web标准的浏览器

。请参阅< URL:http://www.mozilla.org/>。



I assume you are creating the Web page''s HTML dynamically from the
log file via some kind of script operating outside the Web page.

In the HEAD section of the generated HTML file, include the
following line:
<meta http-equiv="Refresh" content="nn">
where nn is some integer. The page will refresh every nn seconds.

See <URL:http://cad.chp.ca.gov/>. The middle frame has nn=30.

--

David E. Ross
<URL:http://www.rossde.com/>

I use Mozilla as my Web browser because I want a browser that
complies with Web standards. See <URL:http://www.mozilla.org/>.


David Ross< no **** @ nowhere.not>写道:
David Ross <no****@nowhere.not> writes:
我假设你是通过网页外部运行的某种脚本从
日志文件中动态创建网页的HTML。


是的。基本上我正走在使用基于Web的界面的道路上。

嵌入在网络设备中进行设置和监控。相比

旧的RS232或telnet控制台界面。无论如何,我更多的是嵌入式软件开发人员,所以我不熟悉所有可用于Web浏览器的不同技术。一个HTML界面

似乎不错,因为最终用户不需要在他们的计算机上安装任何软件

来配置和监控我正在工作的设备。

在生成的HTML文件的HEAD部分,包括
以下行:
< meta http-equiv =" Refresh" content =" nn">
其中nn是某个整数。页面将每n秒刷新一次。

请参阅< URL:http://cad.chp.ca.gov/>。中间框架的nn = 30。
I assume you are creating the Web page''s HTML dynamically from the
log file via some kind of script operating outside the Web page.
Yes. Basically I''m going down the path of using a web based interface
embedded in a network device for setup and monitoring. As opposed to
the good old RS232 or telnet console interface. Anyway, I''m more of
an embedded software developer so am not familiar with all the
different techniques usable with a web browser. A HTML interface
seemed nice in that the end user doesn''t need to install any software
on their computer to configure and monitor the device I''m working on.
In the HEAD section of the generated HTML file, include the
following line:
<meta http-equiv="Refresh" content="nn">
where nn is some integer. The page will refresh every nn seconds.

See <URL:http://cad.chp.ca.gov/>. The middle frame has nn=30.




听起来这对我想做的事情有用。我会看看,当浏览器不支持
支持Java时,我是否可以弄清楚如何使用刷新标签。


-

dano



This sounds like it will work for what I want to do. I''ll see if I
can figure out how to use the refresh tag when the browser doesn''t
support Java.

--
dano


这篇关于将日志文件添加到网页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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