This commit is contained in:
Flaminel
2025-05-21 20:49:40 +03:00
parent 9bd46d7255
commit 0bd4e77e9d

View File

@@ -1,22 +1,15 @@
using System.Collections;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
using Microsoft.Extensions.Logging;
using Serilog;
namespace Infrastructure.Logging;
/// <summary>
/// A background service that initializes deferred logging components after startup
/// </summary>
// TODO remove
public class LoggingInitializer : BackgroundService
{
private readonly IServiceProvider _serviceProvider;
private readonly ILogger<LoggingInitializer> _logger;
public LoggingInitializer(IServiceProvider serviceProvider, ILogger<LoggingInitializer> logger)
public LoggingInitializer(ILogger<LoggingInitializer> logger)
{
_serviceProvider = serviceProvider;
_logger = logger;
}
@@ -26,7 +19,7 @@ public class LoggingInitializer : BackgroundService
{
try
{
throw new Exception("eroare e ceva ce multa lume n-are, ye");
throw new Exception("test exception");
}
catch (Exception exception)
{
@@ -35,7 +28,5 @@ public class LoggingInitializer : BackgroundService
await Task.Delay(30000, stoppingToken);
}
// We only need to run this once at startup
}
}