gpt4 book ai didi

java - 冷聚变 : Runtime show logs on CF page just like Console or Putty

转载 作者:行者123 更新时间:2023-11-29 03:05:54 24 4
gpt4 key购买 nike

我在这个应用程序中开发应用程序,我必须在任何更新到来时显示运行时日志,它应该以正确的方式显示。我的意思是说它应该像控制台一样在 coldfusion 页面上显示日志。我知道在 AJAX 的帮助下是可能的,但我不知道在冷聚变中该怎么做。我不想每秒都运行调度程序。我还有其他方法可以做到这一点吗?

如果您需要更多详细信息或者我不清楚,请告诉我......

谢谢

最佳答案

DirectoryWatcherGateway

The DirectoryWatcherGateway event gateway sends events to the listener CFC when a file is created, deleted, or modified in a directory. The watcher runs in a thread that sleeps for an interval specified in the configuration file, and when the interval has passed, checks for changes since the last time it was awake. If it finds added, deleted, or changed files, it sends a message to a listener CFC. You can configure separate CFCs for add, delete, and change events, or use a single CFC for all events. The source for this event gateway is located in the gateway/src/examples/watcher directory.

http://help.adobe.com/en_US/ColdFusion/10.0/Developing/WSc3ff6d0ea77859461172e0811cbec22c24-77f7.html

一旦检测到修改(通过轮询),您就可以在 Linux 中使用 tail 返回最后 x 行:https://stackoverflow.com/a/16375840/35634

Get-Content -tail 在 Windows 的 Powershell 中 https://technet.microsoft.com/en-gb/library/hh849787.aspx

最后,您可以使用 Sever Sent Event (本质上是 ajax 长轮询)或 cfwebsocket (CF10 或更高版本)将最后 x 行推送到客户端。

关于java - 冷聚变 : Runtime show logs on CF page just like Console or Putty,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32192261/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com