gpt4 book ai didi

ruby-on-rails - Rails 开发日志文件中缺少有关参数和渲染部分的信息

转载 作者:行者123 更新时间:2023-12-04 06:11:54 25 4
gpt4 key购买 nike

这是正常的 Rails 3.2 日志文件条目的样子:

Started GET "/admin" for 127.0.0.1 at 2013-08-05 14:36:43 +0200  
Processing by Admin::PagesController#show as HTML
Parameters: {"id"=>"admin/dashboard"}
Post Load (1.5ms) SELECT 'posts'.* FROM 'posts' WHERE 'posts'.'riddle' = 1 AND 'posts'.'solved_at' <= '2013-08-05 12:36:43' ORDER BY comments_count DESC LIMIT 1
[...]
CACHE (0.0ms) SELECT 'comments'.* FROM 'comments' WHERE 'comments'.'post_id' = 74 ORDER BY 'comments'.'id' DESC LIMIT 1
(0.3ms) SELECT COUNT(*) FROM 'posts' WHERE 'posts'.'riddle' = 1
Rendered admin/dashboard.html.haml within layouts/admin (109.1ms)
Rendered shared/admin/_header.html.haml (3.8ms)

问题:在我的一个应用程序中,前导 Processing ...Parameters: ... 以及尾随 Rendered ... 缺少几行,我一辈子都弄不明白为什么!

Started GET "/admin" for 127.0.0.1 at 2013-08-05 14:36:43 +0200  
Post Load (1.5ms) SELECT 'posts'.* FROM 'posts' WHERE 'posts'.'riddle' = 1 AND 'posts'.'solved_at' <= '2013-08-05 12:36:43' ORDER BY comments_count DESC LIMIT 1
[...]
CACHE (0.0ms) SELECT 'comments'.* FROM 'comments' WHERE 'comments'.'post_id' = 74 ORDER BY 'comments'.'id' DESC LIMIT 1
(0.3ms) SELECT COUNT(*) FROM 'posts' WHERE 'posts'.'riddle' = 1

该应用程序太大,包含太多 gem ,无法在此处发布相关部分,但我尝试在开发中删除 gem ,验证日志级别设置为 :debug,记录器是标准的一个等等

有人见过这个吗?

最佳答案

检查 ActionController::Base 使用的 Logger 是否与应用其余部分使用的相同。在 Rails 控制台中,ActionController::Base.logger == Rails.logger 应该是 true

如果它是 false,那么应用程序正在某处为 ActionController::Base 设置一个特定的 Logger,使用类似 的东西ActionController::Base.logger = ActiveSupport::TaggedLogging.new(Logger.new('log/controllers.log'))

关于ruby-on-rails - Rails 开发日志文件中缺少有关参数和渲染部分的信息,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18602228/

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