Enhance logging, Swagger, and XML documentation support

This commit is contained in:
tekh 2025-12-08 10:44:15 +01:00
parent ae548d530f
commit b4966585ae
2 changed files with 10 additions and 2 deletions

View File

@ -4,6 +4,7 @@ using NLog.Web;
using ReC.API.Middleware;
using ReC.Application;
using ReC.Infrastructure;
using System.Reflection;
using LogLevel = Microsoft.Extensions.Logging.LogLevel;
var logger = LogManager.Setup().LoadConfigurationFromAppSettings().GetCurrentClassLogger();
@ -48,7 +49,12 @@ try
builder.Services.AddControllers();
// Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle
builder.Services.AddEndpointsApiExplorer();
builder.Services.AddSwaggerGen();
builder.Services.AddSwaggerGen(c =>
{
var xmlFile = $"{Assembly.GetExecutingAssembly().GetName().Name}.xml";
var xmlPath = Path.Combine(AppContext.BaseDirectory, xmlFile);
c.IncludeXmlComments(xmlPath);
});
var app = builder.Build();

View File

@ -15,6 +15,8 @@
<FileVersion>1.0.0.0</FileVersion>
<InformationalVersion>1.0.0-beta</InformationalVersion>
<Copyright>Copyright © 2025 Digital Data GmbH. All rights reserved.</Copyright>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<NoWarn>$(NoWarn);1591</NoWarn>
</PropertyGroup>
<ItemGroup>