如何从日志中忽略 Rails 3 资产
是否可以破解 Rails3 中的记录器以忽略对资产的请求?
当日志里写满了
Started GET "/assets/tiscali.png" for 127.0.0.1 at 2011-09-09 19:59:45 +0200
Served asset /tiscali.png - 304 Not Modified (0ms)
“谢谢”时,在日志中找到一些东西真是太疯狂了!
Possible Duplicate:
How to disable logging of asset pipeline (sprockets) messages in Rails 3.1?
is possible to hack logger in Rails3 to ignore requests for assets?
It is maddness to find something in log, when it is full of
Started GET "/assets/tiscali.png" for 127.0.0.1 at 2011-09-09 19:59:45 +0200
Served asset /tiscali.png - 304 Not Modified (0ms)
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我认为这可能会有所帮助 https://github.com/evrone/quiet_assets
I think this could help https://github.com/evrone/quiet_assets
显然,截至 2011 年 11 月 2 日,问题 仍然处于开放状态。
解决方案可在类似的问题:如何禁用资产管道的日志记录( Rails 3.1 中的链轮)消息?
Apparently the issue is still open as of 02 Nov 2011.
A workaround solution is available in a similar question: How to disable logging of asset pipeline (sprockets) messages in Rails 3.1?
反向选择怎么样?
tail -f log/development.log |
tail -f log/development.log | grep -v asset
这基本上输出除了包含单词“asset”的行之外的所有内容。
How about an invert selection?
tail -f log/development.log | grep -v asset
This basically outputs everything except for the lines that contain the word "asset".
Rails 3.2:
使用以下内容创建初始化程序:
从此处: https://github.com/rails/导轨/问题/2639
Rails 3.2:
create a initializer with the content:
From here: https://github.com/rails/rails/issues/2639