Skip to content
Snippets Groups Projects
Commit e14bb160 authored by Brian Neel's avatar Brian Neel
Browse files

Add logging for rack attack events

parent 0e0f1dea
No related branches found
No related tags found
1 merge request!890CE upstream
---
title: Add logging for rack attack events to production.log
merge_request:
author:
# Adds logging for all Rack Attack blocks and throttling events.
ActiveSupport::Notifications.subscribe('rack.attack') do |name, start, finish, request_id, req|
if [:throttle, :blacklist].include? req.env['rack.attack.match_type']
Rails.logger.info("Rack_Attack: #{req.env['rack.attack.match_type']} #{req.ip} #{req.request_method} #{req.fullpath}")
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment