diff --git a/src/Api/Middleware/CustomIpRateLimitMiddleware.cs b/src/Api/Middleware/CustomIpRateLimitMiddleware.cs index 1dc9f48efd..ab6d5e21ae 100644 --- a/src/Api/Middleware/CustomIpRateLimitMiddleware.cs +++ b/src/Api/Middleware/CustomIpRateLimitMiddleware.cs @@ -59,7 +59,7 @@ namespace Bit.Api.Middleware if(blockedCount > 10) { _blockIpService.BlockIpAsync(identity.ClientIp, false); - _logger.LogDebug("Blocked " + identity.ClientIp); + _logger.LogInformation($"Blocked {identity.ClientIp}"); } else { diff --git a/src/Api/Startup.cs b/src/Api/Startup.cs index d781be605e..b4d99a3c42 100644 --- a/src/Api/Startup.cs +++ b/src/Api/Startup.cs @@ -238,12 +238,13 @@ namespace Bit.Api Func serilogFilter = (e) => { var context = e.Properties["SourceContext"].ToString(); - if(e.Exception != null && e.Exception.GetType() == typeof(SecurityTokenValidationException) || e.Exception.Message == "Bad security stamp.") + if(e.Exception != null && (e.Exception.GetType() == typeof(SecurityTokenValidationException) || + e.Exception.Message == "Bad security stamp.")) { return false; } - if(context == typeof(IpRateLimitMiddleware).FullName && e.Level == LogEventLevel.Information) + if(context.Contains(typeof(IpRateLimitMiddleware).FullName) && e.Level == LogEventLevel.Information) { return true; }