mirror of
https://github.com/samsonjs/rack-attack.git
synced 2026-03-25 09:25:49 +00:00
README: describe instrumentation
This commit is contained in:
parent
0faab21338
commit
4d8195f783
1 changed files with 9 additions and 0 deletions
|
|
@ -95,6 +95,15 @@ Similarly for blacklisted responses:
|
|||
|
||||
## Logging & Instrumentation
|
||||
|
||||
Rack::Attack uses the [ActiveSupport::Notifications](http://api.rubyonrails.org/classes/ActiveSupport/Notifications.html) API if available.
|
||||
|
||||
You can subscribe to 'rack.attack' events and do whatever:
|
||||
|
||||
ActiveSupport::Notifications.subscribe("rack.attack") do |hash|
|
||||
# Log it
|
||||
# Graph it using statsd
|
||||
end
|
||||
|
||||
## Motivation
|
||||
|
||||
Abusive clients range from malicious login crackers to naively-written scrapers.
|
||||
|
|
|
|||
Loading…
Reference in a new issue