feat: add integration with seq
This commit is contained in:
@ -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);
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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()
|
||||
{
|
||||
|
Reference in New Issue
Block a user