feat: add integration with seq
Some checks failed
.NET Test Pipeline / build-and-test (push) Failing after 1m43s
Build and Deploy Docker Container / build-and-deploy (push) Failing after 2m6s

This commit is contained in:
2024-12-22 07:13:59 +03:00
parent 9231c4d5ca
commit 85722f8552
6 changed files with 49 additions and 2 deletions

View File

@ -24,7 +24,6 @@ public class MaintenanceModeMiddleware(RequestDelegate next, IMaintenanceModeSer
context.Response.StatusCode = StatusCodes.Status503ServiceUnavailable;
context.Response.ContentType = "plain/text";
string error;
if (maintenanceModeService.IsMaintenanceMode)
throw new ServerUnavailableException("The service is currently undergoing maintenance. Please try again later.", true);

View File

@ -45,6 +45,12 @@ public static class LoggerConfiguration
rollingInterval: RollingInterval.Day);
}
#if !DEBUG
if (generalConfig != null && !string.IsNullOrEmpty(generalConfig.ApiServerSeq) &&
Uri.TryCreate(generalConfig.ApiServerSeq, UriKind.Absolute, out var _))
configuration.WriteTo.Seq(generalConfig.ApiServerSeq, apiKey: generalConfig.ApiKeySeq);
#endif
configuration
.MinimumLevel.Override("Microsoft.AspNetCore.Hosting", LogEventLevel.Warning)
.MinimumLevel.Override("Microsoft.AspNetCore.Mvc", LogEventLevel.Warning)

View File

@ -9,6 +9,8 @@ public class LogSettings : IIsConfigured
public bool EnableLogToFile { get; set; }
public string? LogFilePath { get; set; }
public string? LogFileName { get; set; }
public string? ApiKeySeq { get; set; }
public string? ApiServerSeq { get; set; }
public bool IsConfigured()
{