Skip to content

Commit

Permalink
fix: Exclude any exception due to cancellation
Browse files Browse the repository at this point in the history
  • Loading branch information
hez2010 committed Apr 14, 2024
1 parent be3fa79 commit 3d6dab1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/GZCTF/Utils/LogHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,7 @@ public static ILogger GetLogger(IConfiguration configuration, IServiceProvider s
v.TrimEnd('/').Equals("/metrics", StringComparison.OrdinalIgnoreCase) ||
v.StartsWith("/assets", StringComparison.OrdinalIgnoreCase)))
.Filter.ByExcluding(logEvent =>
logEvent.Exception != null &&
logEvent.Exception.GetType() == typeof(OperationCanceledException))
logEvent.Exception is OperationCanceledException)
.MinimumLevel.Debug()
.MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
.MinimumLevel.Override("AspNetCoreRateLimit", LogEventLevel.Warning)
Expand Down

0 comments on commit 3d6dab1

Please sign in to comment.