在生产中启用完整的回溯记录 [英] Enable full backtrace-logging in production
问题描述
我仅在生产中遇到错误,并且要调试该错误,我想在生产中启用完整的回溯.
I am getting an error only in production and to debug that, I would like to enable full backtracing in production.
我在config/environments/production.rb
中已经有config.log_level = :debug
,但这并没有给我回溯的痕迹,只记录了查询,请求和服务资产的详细信息.
I already have config.log_level = :debug
in config/environments/production.rb
, but that does not give me a backtrace, only logs the queries, requests and and served assets in detail.
推荐答案
要在生产环境中显示回溯,请在config/environments/production.rb
中设置config.consider_all_requests_local = true
.最好不要启用此功能,但是在设置新的生产环境时会很有用.
To show backtraces in the production environment, set config.consider_all_requests_local = true
in config/environments/production.rb
. It's not good practice to leave this turned on, however it can be useful when provisioning a new production environment.
这篇关于在生产中启用完整的回溯记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!