Improve logging on Gitlab::Auth::TooManyIps events

Problem

When users are blocked due to IP address restrictions, the system only logs a generic 403 error in production_json.log. The current logging lacks essential information, including user metadata (.meta.user), making it difficult for administrators to effectively troubleshoot access issues.

Impact

Administrators are unable to:

  1. Determine the reason behind user-reported 403 responses
  2. Identify which users are affected by IP address restrictions
  3. Effectively troubleshoot access-related issues

Expected Behavior

The logging system should provide detailed information when users are blocked due to IP address restrictions, including:

  • User metadata
  • Reason for the block

This would enable administrators to properly investigate and resolve access issues.

Current Behavior

Only a generic 403 error is logged in production_json.log without any additional context or user information.

Edited by 🤖 GitLab Bot 🤖