您可以在跟踪development.log时抑制资产消息吗?

发布于 2024-12-09 15:33:49 字数 1104 浏览 0 评论 0原文

在 Ruby on Rails 应用程序的开发过程中,我通过 tail -f log/development.log 不断跟踪开发日志。

我几周前才开始使用 Rails 进行开发,所以我不知道日志是否总是显示这么多条目,但我相信最近在 3.1 中添加了资产。无论如何,这是我的 development.log 的页面调用摘录:

Started GET "/assets/reset.css?body=1" for 70.63.17.68 at Wed Oct 12 20:10:49 +0000 2011
Served asset /reset.css - 304 Not Modified (1ms)


Started GET "/assets/style.css?body=1" for 70.63.17.68 at Wed Oct 12 20:10:49 +0000 2011
Served asset /style.css - 304 Not Modified (0ms)


Started GET "/assets/application.css?body=1" for 70.63.17.68 at Wed Oct 12 20:10:49 +0000 2011
Started asset /application.css - 304 Not Modified (0ms)


Started GET "/assets/application.js?body=1" for 70.63.17.68 at Wed Oct 12 20:10:49 +0000 2011
Served asset /application.js - 200 OK (1ms)

实际上还有一些条目,但我想您已经了解了这占用了所有新内容的大量空间。每个 GET 请求之间的行。我还删除了 Rails 在使用 generate 时创建的所有未使用的 scss 和 Coffee 文件。

我只想在tail 时在我的development.log 中查看所有数据库调用和实际页面调用。

我想知道是否有人知道如何阻止 Rails 记录这些事件,或者是否有 | grep 排除与资产相关的所有内容的方法。

非常感谢帮助,谢谢。

During development of Ruby on Rails applications I have the development log constantly tailing via tail -f log/development.log.

I have only started developing in Rails a few weeks ago, so I don't know if the log has always shown this many entries, but I believe assets have just recently been added in 3.1. Regardless, this is an exerpt of my development.log for a page call:

Started GET "/assets/reset.css?body=1" for 70.63.17.68 at Wed Oct 12 20:10:49 +0000 2011
Served asset /reset.css - 304 Not Modified (1ms)


Started GET "/assets/style.css?body=1" for 70.63.17.68 at Wed Oct 12 20:10:49 +0000 2011
Served asset /style.css - 304 Not Modified (0ms)


Started GET "/assets/application.css?body=1" for 70.63.17.68 at Wed Oct 12 20:10:49 +0000 2011
Started asset /application.css - 304 Not Modified (0ms)


Started GET "/assets/application.js?body=1" for 70.63.17.68 at Wed Oct 12 20:10:49 +0000 2011
Served asset /application.js - 200 OK (1ms)

There are actually a few more entried, but I think you got the picture of this taking up a lot of space with all the new lines in between each GET request. I also delete all the unused scss and coffee files that Rails creates when using generate.

I just want to see all database calls and actual page calls in my development.log when I tail it.

I was wondering if anyone knows of a way to stop Rails logging these events, or if there is a | grep way of excluding everything related to assets.

Help is much appretiated, thanks.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

離殇 2024-12-16 15:33:49

在您的 config/environments/development.rb 中设置

config.assets.debug = false

In your config/environments/development.rb set

config.assets.debug = false

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文