diff --git a/src/GZCTF/Utils/LogHelper.cs b/src/GZCTF/Utils/LogHelper.cs index 2e383837d..4fc60a41d 100644 --- a/src/GZCTF/Utils/LogHelper.cs +++ b/src/GZCTF/Utils/LogHelper.cs @@ -129,7 +129,8 @@ public static ILogger GetLogger(IConfiguration configuration, IServiceProvider s .Enrich.FromLogContext() .Filter.ByExcluding( Matching.WithProperty("RequestPath", v => - "/healthz".Equals(v, StringComparison.OrdinalIgnoreCase) || + v.TrimEnd('/').Equals("/healthz", StringComparison.OrdinalIgnoreCase) || + v.TrimEnd('/').Equals("/metrics", StringComparison.OrdinalIgnoreCase) || v.StartsWith("/assets", StringComparison.OrdinalIgnoreCase))) .Filter.ByExcluding(logEvent => logEvent.Exception != null &&