Logging module that replaces the default ASP.NET logger with Serilog.
dotnet add package AspNet.Module.LoggingLogging can be configured through appsettings.json or environment variables.
{
"Serilog": {
"MinimumLevel": "Verbose",
"ServiceName": "Service name for Elastic",
"Sinks": {
"Elasticsearch": {
"Url": "Elastic URL",
"TemplateVersion": 7
}
}
}
}using AspNet.Module.Logging;
var builder = AspNetWebApplication.CreateBuilder(args);
builder.RegisterModule<LoggingModule>();
var app = builder.Build();
await app.RunWithLogging();- Repository: github.com/aspnet-modules/aspnet-module-logging