PlanTempusApp/Core/ModuleRegistry/SeqLoggingModule.cs

33 lines
775 B
C#
Raw Normal View History

using Autofac;
using PlanTempus.Core.Logging;
using PlanTempus.Core.Telemetry;
namespace PlanTempus.Core.ModuleRegistry
{
2025-02-20 17:14:53 +01:00
public class SeqLoggingModule : Module
{
public required SeqConfiguration SeqConfiguration { get; set; }
2025-02-20 17:14:53 +01:00
protected override void Load(ContainerBuilder builder)
{
//builder.RegisterType<MessageChannel>()
// .As<IMessageChannel<Microsoft.ApplicationInsights.Channel.ITelemetry>>()
// .SingleInstance();
2025-02-20 17:14:53 +01:00
builder.RegisterType<SeqBackgroundService>()
.As<Microsoft.Extensions.Hosting.IHostedService>()
.SingleInstance();
2025-02-20 17:14:53 +01:00
builder.RegisterGeneric(typeof(SeqLogger<>));
2025-02-20 17:14:53 +01:00
builder.RegisterInstance(SeqConfiguration);
2025-02-20 17:14:53 +01:00
builder.RegisterType<SeqHttpClient>()
.As<SeqHttpClient>()
.SingleInstance();
}
}
}