简体   繁体   English

如何在开发模式下将所有HTTP请求记录到Rails应用程序?

[英]How can I log all HTTP requests to rails app in development mode?

I'd like to be able to log all http requests to a rails app, even those to static assets in the public folder. 我希望能够将所有http请求记录到Rails应用程序中,甚至也可以记录到公共文件夹中的静态资源中。 I'd like to do this with a standard rails setup, eg using ./script/server, and without installing Apache, etc. 我想使用标准的Rails设置来执行此操作,例如使用./script/server,而无需安装Apache等。

I tried wireshark, but it seems like it doesn't track local traffic. 我尝试了Wireshark,但似乎无法跟踪本地流量。 I also tried to use the request object, but that only knows about the request url, not the subsequent css+image+js assets. 我也尝试使用request对象,但这只知道请求url,而不知道随后的css + image + js资产。

I'm using Rails 2.3.4 on Mac OS 10.5. 我在Mac OS 10.5上使用Rails 2.3.4。 By the way, Yslow, etc. won't work for my setup (android development). 顺便说一句,Yslow等不适用于我的设置(Android开发)。

$ {RAILS_ROOT} /log/development.log不是enoug吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我的Rails应用程序为其所有URL返回HTTP 500,但日志文件中没有显示任何内容。我该如何诊断问题? - My Rails app is returning HTTP 500 for all its URLs, but nothing shows up in the log file. How can I diagnose the problem? 如何在开发模式下强制Rails 3.2按请求重新加载已安装的机架应用程序? - How can I force Rails 3.2 to reload mounted rack app per request in development mode? 如何将Rails 3应用程序设置为开发模式? - How do I set my rails 3 app to development mode? Rails:如何记录执行超过4秒的所有请求? - Rails: How can I log all requests which take more than 4s to execute? 如何在开发模式下控制Rails / Webrick调试日志记录? - How can I control rails/webrick debug logging in development mode? 如何为开发模式的链接配置Rails 3.0.7主机? - How can I configure Rails 3.0.7 host for links for development mode? 在Rails开发模式下记录日志? - Log rotation in Rails DEVELOPMENT mode? 在开发模式下如何在Rails应用程序上工作,而在生产模式下将其推送? - How do I work on my Rails app in development mode, but push it in production mode? 我们如何观看Rails开发日志? - How can we watch the Rails development log? 如何在Rails中记录原始的HTTP请求/响应? - How can I log the raw http request/response in rails?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM