简体   繁体   中英

Ruby on Rails 2.3.8 - Airbrake Ignore by IP Address

I am using the Airbrake gem to report errors in my rails application.

Is it possible to not have reports sent if it has a certain IP address, I would like to ignore the following:

213.233.458.*

I have looked at the docs and noticed a method called ignore_by_filters but wondering how I would employ this to ignore by IP address.

Does the exception_data variable hold information on the requesting IP or any other way to access it?

You could just use:

Airbrake.notify e unless request.remote_ip == "ip"

request.remote_ip can be accessed in the controller, so you could just pass this to the model if needed.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM