limit_req_log_level
The `limit_req_log_level` directive sets the logging level for request limiting logs in NGINX.
Description
The limit_req_log_level directive allows administrators to specify the logging severity level at which request limit violations will be recorded. This directive can be defined in the http, server, or location contexts and it accepts a single argument that represents the log level. The available levels include error, warn, info, debug, etc. By default, if not configured, NGINX uses the log level error for request limit logging.
When the request limits defined using the limit_req_zone directive are exceeded, NGINX can log these events according to the specified logging level. This is essential for monitoring purposes, allowing you to adjust your logging verbosity based on your operational requirements or to troubleshoot issues related to traffic throttling. This is particularly useful in high-traffic environments where excessive logging can obscure critical information. The logging mechanism is integrated with NGINX's error logging capabilities, meaning you can review these logs to identify patterns and take appropriate action to optimize your request handling.
Config Example
http {
limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;
limit_req_log_level warn;
}Setting a very high log level like debug can generate an excessive amount of log data, which could fill up disk space quickly.
If not configured, the default logging level might lead to missed important information about rate limiting issues.