AspNetCoreRateLimit
AspNetCoreRateLimit copied to clipboard
Support defining log level of blocked request message via configuration.
Although as suggested in the documents you can override the LogBlockedRequest on the IpRateLimitMiddleware. It would be nice to be able to specify the log level of this message via configuration.
@ymor can I get a sample on how to override the LogBlockedRequest
? Overriding IpRateLimitMiddleware.LogBlockedRequest
will have us override it's constructor too , getting values for which is difficult.
Hi, @manisha201301 I don't have an example handy but the values for the constructor should be populated by the DependencyInjection framework assuming you have registered them with one of the AddInMemoryRateLimiting
or AddDistributedRateLimiting
methods in your startup. See https://github.com/stefanprodan/AspNetCoreRateLimit/blob/d95385e534656dc8bad276637e51cb2e9bc40f44/src/AspNetCoreRateLimit/StartupExtensions.cs
Thanks, also this solved my problem: https://github.com/stefanprodan/AspNetCoreRateLimit/issues/7#issuecomment-261670002