Skip to content

Commit

Permalink
feat: Map LogLevel to LogEventLevel
Browse files Browse the repository at this point in the history
  • Loading branch information
hez2010 authored and GZTimeWalker committed Apr 12, 2024
1 parent 54aa5c1 commit 644eff9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/GZCTF/Models/Internal/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
using GZCTF.Extensions;
using MemoryPack;
using OpenTelemetry.Exporter;
using Serilog.Events;
using Serilog.Sinks.Grafana.Loki;
using IPNetwork = Microsoft.AspNetCore.HttpOverrides.IPNetwork;

Expand Down Expand Up @@ -301,7 +300,7 @@ public class GrafanaLokiOptions
public string[]? PropertiesAsLabels { get; set; }
public LokiCredentials? Credentials { get; set; }
public string? Tenant { get; set; }
public LogEventLevel? RestrictedToMinimumLevel { get; set; }
public LogLevel? MinimumLevel { get; set; }
}

public class ForwardedOptions : ForwardedHeadersOptions
Expand Down
2 changes: 1 addition & 1 deletion src/GZCTF/Utils/LogHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public static ILogger GetLogger(IConfiguration configuration, IServiceProvider s
lokiOptions.PropertiesAsLabels,
lokiOptions.Credentials,
lokiOptions.Tenant,
lokiOptions.RestrictedToMinimumLevel ?? LogEventLevel.Debug);
(LogEventLevel)(lokiOptions.MinimumLevel ?? LogLevel.Trace));
}
}

Expand Down

0 comments on commit 644eff9

Please sign in to comment.