Skip to content

Commit a3295e0

Browse files
committed
fix: 優化日誌記錄,改善被封鎖 IP 和功能未找到的警告訊息
1 parent 62edd6f commit a3295e0

3 files changed

Lines changed: 2 additions & 3 deletions

File tree

src/Netcorext.Auth.Authentication/Middlewares/BlockedIpMiddleware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public async Task InvokeAsync(HttpContext context)
4646

4747
if (cacheBlockedIp.Any(t => t.Value.BeginRange >= ipNumber && t.Value.EndRange <= ipNumber))
4848
{
49-
_logger.LogWarning("Forbidden, This specified ip is blocked: {Ip}", ip);
49+
_logger.LogWarning("Forbidden, The IP '{IP}' is blocked", ip);
5050

5151
await context.ForbiddenAsync(_config.AppSettings.UseNativeStatus, "403008");
5252
}

src/Netcorext.Auth.Authentication/Middlewares/PermissionMiddleware.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ public async Task InvokeAsync(HttpContext context, IDispatcher dispatcher)
8484

8585
if (string.IsNullOrWhiteSpace(functionId))
8686
{
87-
_logger.LogWarning("Forbidden, no function found");
87+
_logger.LogWarning("Forbidden, No function found for path '{Path}'", path);
8888

8989
await context.ForbiddenAsync(_config.AppSettings.UseNativeStatus);
9090

src/Netcorext.Auth.Authentication/Settings/ConfigSettings.cs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
using System.Reflection;
21
using Netcorext.Auth.Extensions.AspNetCore.Settings;
32
using Netcorext.Configuration;
43

0 commit comments

Comments
 (0)