diff options
| author | JP Dillingham <jp@dillingham.me> | 2026-06-07 14:45:04 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-06-07 14:45:04 -0500 |
| commit | b747b68ba0ba777be578e73bd1328fbde940e436 (patch) | |
| tree | 160d23aeb8707dc04f81bb52e81913c1b77bb2a4 /src/slskd/Program.cs | |
| parent | e06999e5eec1616d93b34ffbab0eade617d1aaf6 (diff) | |
| parent | 2d069bbf1f71f38e1286e27d45c24b478feb11ac (diff) | |
| download | slskd-b747b68ba0ba777be578e73bd1328fbde940e436.tar.gz | |
Merge branch 'master' into dependabot/npm_and_yarn/src/web/launch-editor-2.14.1
Diffstat (limited to 'src/slskd/Program.cs')
| -rw-r--r-- | src/slskd/Program.cs | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/slskd/Program.cs b/src/slskd/Program.cs index d4baf276..9a2914ea 100644 --- a/src/slskd/Program.cs +++ b/src/slskd/Program.cs @@ -62,11 +62,12 @@ namespace slskd using Microsoft.Extensions.FileProviders; using Microsoft.Extensions.FileProviders.Physical; using Microsoft.IdentityModel.Tokens; - using Microsoft.OpenApi.Models; + using Microsoft.OpenApi; using Prometheus.DotNetRuntime; using Prometheus.SystemMetrics; using Serilog; using Serilog.Events; + using Serilog.Formatting.Display; using Serilog.Sinks.Grafana.Loki; using Serilog.Sinks.SystemConsole.Themes; using slskd.Authentication; @@ -1007,6 +1008,7 @@ namespace slskd services.AddSwaggerGen(options => { options.DescribeAllParametersInCamelCase(); + options.CustomSchemaIds(type => type.FullName); options.SwaggerDoc("v0", new OpenApiInfo { Version = "v0", @@ -1216,6 +1218,7 @@ namespace slskd .MinimumLevel.Override("slskd.Authentication.PassthroughAuthenticationHandler", LogEventLevel.Warning) .MinimumLevel.Override("slskd.Authentication.ApiKeyAuthenticationHandler", LogEventLevel.Warning) .MinimumLevel.Override("Microsoft.EntityFrameworkCore.Database.Command", LogEventLevel.Warning) // bump this down to Information to show SQL + .Enrich.WithProperty("App", AppName) .Enrich.WithProperty("InstanceName", OptionsAtStartup.InstanceName) .Enrich.WithProperty("InvocationId", InvocationId) .Enrich.WithProperty("ProcessId", ProcessId) @@ -1234,9 +1237,13 @@ namespace slskd retainedFileTimeLimit: TimeSpan.FromDays(OptionsAtStartup.Retention.Logs)))) .WriteTo.Conditional( e => !string.IsNullOrEmpty(OptionsAtStartup.Logger.Loki), - config => config.GrafanaLoki( - OptionsAtStartup.Logger.Loki ?? string.Empty, - outputTemplate: "[{Timestamp:HH:mm:ss} {Level:u3}] {Message:lj}{NewLine}{Exception}")) + config => + { + if (!string.IsNullOrEmpty(OptionsAtStartup.Logger.Loki)) + { + config.GrafanaLoki(OptionsAtStartup.Logger.Loki); + } + }) .WriteTo.Sink(new DelegatingSink(logEvent => { string message = default; |
