dynamic_limit_req_log_level

The `dynamic_limit_req_log_level` directive specifies the logging level for request handling failures and delays due to rate limiting.

Syntaxdynamic_limit_req_log_level level;
Defaultnotice
Contexthttp, server, location
Arguments1

Description

The dynamic_limit_req_log_level directive is used within the NGINX dynamic IP limiting module to define how much information should be logged when requests are refused or delayed due to exceeding configured rate limits. This directive accepts a single argument that determines the severity level of logging from a predefined set of log levels, such as 'info', 'notice', 'warn', and 'error'.

The behavior of the directive is such that the logging level configured here is applied explicitly to requests that are outright refused due to rate limiting, while any delays in processing related to rate limiting are logged at a level one step lower than the configured refusal level. For instance, if 'warn' is chosen for refusals, delayed requests will be logged as 'error'. This structured logging helps maintain clarity on what type of issue occurred—whether a processing delay or a complete denial—thereby aiding in effective troubleshooting and monitoring of application performance.

This directive can be configured at the HTTP, server, or location context levels, allowing administrators flexibility in setting different log levels based on the specific needs of their application or service. Ample logging aids in the assessment of how well the rate-limiting is functioning and can inform scaling decisions or modifications to the rate-limiting logic.

Config Example

http {
    dynamic_limit_req_log_level warn;
}
server {
    location / {
        dynamic_limit_req_log_level info;
    }
}

Ensure the specified log level is supported; otherwise, the default will be used.

Remember that delayed request logs are recorded at a level lower than the refusal level, which can be confusing if not documented properly.

The directive must be set in the appropriate context to take effect; using it in an unsupported context will result in an error.

← Back to all directives