Working on BackgroundService

This commit is contained in:
Janus Knudsen 2025-02-20 17:14:53 +01:00
parent 9f4996bc8f
commit ad4ed12f00
12 changed files with 368 additions and 317 deletions

View file

@ -4,25 +4,29 @@ using PlanTempus.Core.Telemetry;
namespace PlanTempus.Core.ModuleRegistry
{
public class SeqLoggingModule : Module
{
protected override void Load(ContainerBuilder builder)
{
public class SeqLoggingModule : Module
{
public required SeqConfiguration SeqConfiguration { get; set; }
builder.RegisterType<MessageChannel>()
.As<IMessageChannel<Microsoft.ApplicationInsights.Channel.ITelemetry>>()
.SingleInstance();
protected override void Load(ContainerBuilder builder)
{
builder.RegisterType<SeqBackgroundService>()
.As<Microsoft.Extensions.Hosting.IHostedService>()
.SingleInstance();
builder.RegisterType<MessageChannel>()
.As<IMessageChannel<Microsoft.ApplicationInsights.Channel.ITelemetry>>()
.SingleInstance();
builder.RegisterType<SeqHttpClient>()
.As<SeqHttpClient>()
.SingleInstance();
builder.RegisterType<SeqBackgroundService>()
.As<Microsoft.Extensions.Hosting.IHostedService>()
.SingleInstance();
builder.RegisterGeneric(typeof(SeqLogger<>));
builder.RegisterInstance(SeqConfiguration);
}
}
builder.RegisterType<SeqHttpClient>()
.As<SeqHttpClient>()
.SingleInstance();
}
}
}