2025-02-13 00:40:42 +01:00
|
|
|
|
using Autofac;
|
2025-03-10 15:56:22 +01:00
|
|
|
|
using PlanTempus.Core.SeqLogging;
|
2025-02-13 00:40:42 +01:00
|
|
|
|
|
2025-02-20 00:23:13 +01:00
|
|
|
|
namespace PlanTempus.Core.ModuleRegistry
|
2025-02-13 00:40:42 +01:00
|
|
|
|
{
|
2025-02-22 20:14:56 +01:00
|
|
|
|
public class SeqLoggingModule : Module
|
|
|
|
|
|
{
|
|
|
|
|
|
public required SeqConfiguration SeqConfiguration { get; set; }
|
2025-02-13 00:40:42 +01:00
|
|
|
|
|
2025-02-22 20:14:56 +01:00
|
|
|
|
protected override void Load(ContainerBuilder builder)
|
|
|
|
|
|
{
|
2025-02-13 00:40:42 +01:00
|
|
|
|
|
2025-02-22 20:14:56 +01:00
|
|
|
|
//builder.RegisterType<MessageChannel>()
|
|
|
|
|
|
// .As<IMessageChannel<Microsoft.ApplicationInsights.Channel.ITelemetry>>()
|
|
|
|
|
|
// .SingleInstance();
|
2025-02-18 16:23:08 +01:00
|
|
|
|
|
2025-02-22 20:14:56 +01:00
|
|
|
|
builder.RegisterType<SeqBackgroundService>()
|
|
|
|
|
|
//.As<Microsoft.Extensions.Hosting.IHostedService>()
|
|
|
|
|
|
.SingleInstance();
|
2025-02-18 16:23:08 +01:00
|
|
|
|
|
2025-02-22 20:14:56 +01:00
|
|
|
|
builder.RegisterGeneric(typeof(SeqLogger<>));
|
2025-02-18 16:23:08 +01:00
|
|
|
|
|
2025-02-22 20:14:56 +01:00
|
|
|
|
builder.RegisterInstance(SeqConfiguration);
|
2025-02-18 16:23:08 +01:00
|
|
|
|
|
2025-02-22 20:14:56 +01:00
|
|
|
|
builder.RegisterType<SeqHttpClient>()
|
|
|
|
|
|
.As<SeqHttpClient>()
|
|
|
|
|
|
.SingleInstance();
|
2025-02-20 17:14:53 +01:00
|
|
|
|
|
2025-02-22 20:14:56 +01:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-02-13 00:40:42 +01:00
|
|
|
|
}
|