0

私はこれをやろうとしています:

config.filter_parameters << lambda do |k,v|
  if k == "content"
    v.slice!(250..-1)
    v.insert(-1, "...[TRUNCATED]")
  end
end

大きな「コンテンツ」フィールドでログを管理しやすくするためです。しかし、例外を生成すると、次のスタック トレースが表示されます。例外通知 3.0、Rails 3.2.8

アイデア?

ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/http/parameter_filter.rb:40:in `dup'
ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/http/parameter_filter.rb:40:in `block (2 levels) in compiled_filter'
ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/http/parameter_filter.rb:32:in `each'
ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/http/parameter_filter.rb:32:in `block in compiled_filter'
ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/http/parameter_filter.rb:11:in `call'
ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/http/parameter_filter.rb:11:in `filter'
ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/http/parameter_filter.rb:36:in `block (2 levels) in compiled_filter'
ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/http/parameter_filter.rb:32:in `each'
ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/http/parameter_filter.rb:32:in `block in compiled_filter'
ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/http/parameter_filter.rb:11:in `call'
ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/http/parameter_filter.rb:11:in `filter'
ruby/1.9.1/gems/actionpack-3.2.8/lib/action_dispatch/http/filter_parameters.rb:38:in `filtered_env'
ruby/1.9.1/gems/exception_notification-3.0.0/lib/exception_notifier/views/exception_notifier/_environment.text.erb:1:in `__home_myappuser_myapp_shared_bundle_ruby_______gems_exception_notification_______lib_exception_notifier_views_exception_notifier__environment_text_erb__953280712_90713590'
ruby/1.9.1/gems/actionpack-3.2.8/lib/action_view/template.rb:145:in `block in render'
ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/notifications.rb:125:in `instrument'
ruby/1.9.1/gems/actionpack-3.2.8/lib/action_view/template.rb:143:in `render'
ruby/1.9.1/gems/actionpack-3.2.8/lib/action_view/renderer/partial_renderer.rb:265:in `render_partial'
ruby/1.9.1/gems/actionpack-3.2.8/lib/action_view/renderer/partial_renderer.rb:238:in `block in render'
ruby/1.9.1/gems/actionpack-3.2.8/lib/action_view/renderer/abstract_renderer.rb:38:in `block in instrument'
ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `block in instrument'
ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
ruby/1.9.1/gems/activesupport-3.2.8/lib/active_support/notifications.rb:123:in `instrument'
ruby/1.9.1/gems/actionpack-3.2.8/lib/action_view/renderer/abstract_renderer.rb:38:in `instrument'
ruby/1.9.1/gems/actionpack-3.2.8/lib/action_view/renderer/partial_renderer.rb:237:in `render'
ruby/1.9.1/gems/actionpack-3.2.8/lib/action_view/renderer/renderer.rb:41:in `render_partial'
ruby/1.9.1/gems/actionpack-3.2.8/lib/action_view/helpers/rendering_helper.rb:27:in `render'
ruby/1.9.1/gems/exception_notification-3.0.0/lib/exception_notifier/views/exception_notifier/exception_notification.text.erb:9:in `block in __home_myappuser_myapp_shared_bundle_ruby_______gems_exception_notification_______lib_exception_notifier_views_exception_notifier_exception_notification_text_erb___442452799_85036510'
4

0 に答える 0