ColdFusion 是否保留使用日志?
我想获得 ColdFusion 应用程序的一些使用统计信息。该应用程序太大,无法向每个页面添加任何自定义日志记录。我知道 ColdFusion 维护错误和异常日志,但它是否维护任何类型的使用日志,每个页面加载一个条目?我知道有一个通过管理员启动的监控应用程序,但这并不是我正在寻找的。
编辑:
亚当·卡梅伦和安东尼指出,哦,是的,我从来没有说过我要寻找什么统计数据:
最低限度:加载的页面、页面加载的日期和时间。 想要:经过身份验证的用户 真的很想但不认为我会得到:每个页面请求的经过时间
原因是我已经制作了一个小应用程序来显示 Oracle Apex 应用程序的使用统计信息。我还想包含 ColdFusion 的统计数据。
解析 Apache 日志似乎是一种可行的解决方案。其中存在一些小问题,即日志的权限和所有权。我只是希望 CF 在其他地方为我做这件事。
I would like to get some usage statistics for a ColdFusion application. The app is far too large to add any custom logging to each and every page. I know ColdFusion maintains error and exception logs, but does it maintain any sort of usage log, one entry per page load? I know there is a monitoring application launched via the Administrator, but that's not exactly what I'm looking for.
EDIT:
Adam Cameron and anthony point out, oh yeah, I never said what stats I'm looking for:
Bare minimum: the page loaded, date and time of the page load.
Would like to have: the authenticated user
Would really like but don't think I'm going to get: the elapsed time of each page request
The reason for that is that I've whipped up a small app to display usage statistics for Oracle Apex applications. I'd like to include statistics for ColdFusion as well.
Parsing through the Apache logs does seem to be one viable solution. There are minor issues with that, namely permissions and ownership of the logs. I was just hoping CF was doing it for me somewhere else.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您只想记录已发出的页面请求(即:网站访问者点击了哪些 URL),那么您的 Web 服务器将为您记录该信息; CF 中没有内置任何东西可以做到这一点。但是,如果您出于某种原因需要 CF 来执行此操作,那么 Dan 的 OnRequestEnd.cfm 建议是一个很好的建议。我认为这里的 Web 服务器解决方案“更好”,因为它是开箱即用的。
顺便说一句,你并没有真正给出足够的细节来说明你想要什么样的指标。这使得很难给你一个全面的答案。
If you just want a log of what page requests have been made (ie: what URLs visitors to the site are hitting) then your web server will log that for you; there's nothing inbuilt into CF that does it. However if you need CF to do it for some reason, then Dan's suggestion of OnRequestEnd.cfm is a good suggestion. I think the web server solution here is "better" based on the fact it's done out of the box.
You don't, btw, really give enough detail as to what sort of metrics you are after. This makes it difficult to give you a comprehensive answer.
如果您使用的是 application.cfc 文件,那么您可以添加 onRequestEnd 代码以使其可用于整个站点。
If you are using application.cfc file then you can add code onRequestEnd to make it available for whole site.
您有什么理由不只使用 Google Analytics?
http://www.google.com/analytics/
您所需要做的就是嵌入 javascript在页面上,您就可以开始了。
Any reason you don't just use Google Analytics?
http://www.google.com/analytics/
All you would need to do is embed the javascript on the page, and you would be good to go.
您可以在站点根目录下使用
onRequestEnd.cfm
来获得一个在每个请求结束时执行的文件。要根据您编辑的帖子进一步得到答案,您可以使用
getTickCount
、onRequestStart.cfm
和onRequestEnd.cfm
来获取页。像这样:onRequestStart.cfm
onRequestEnd.cfm
You can use
onRequestEnd.cfm
at the root of your site to have a file that executes at the end of every request.To further the answer based on your edited post, you can use
getTickCount
,onRequestStart.cfm
andonRequestEnd.cfm
to get the run time of the page. Like so:onRequestStart.cfm
onRequestEnd.cfm