1
我們正在遷移到Airbrake 5,我想知道如何替換ignore_user_agent
配置的功能。我知道我們必須檢查一個add_filter
區塊,但不知道該在哪裏檢查?如何在Airbrake 5中忽略用戶代理?
有沒有人有一個替換Airbrake 5中的ignore_user_agent配置選項的例子?
我們正在遷移到Airbrake 5,我想知道如何替換ignore_user_agent
配置的功能。我知道我們必須檢查一個add_filter
區塊,但不知道該在哪裏檢查?如何在Airbrake 5中忽略用戶代理?
有沒有人有一個替換Airbrake 5中的ignore_user_agent配置選項的例子?
這將是很容易(假設this fix中合併,新的創業板發佈):
Airbrake.add_filter do |notice|
notice.ignore! if notice[:context][:userAgent].match(/curl/)
end
在此期間,您可以使用the class add_filter API。
來源:https://github.com/airbrake/airbrake-ruby/issues/9
編輯:新寶石出版。