diff --git a/Program.cs b/Program.cs index e5b803f..1e959cc 100644 --- a/Program.cs +++ b/Program.cs @@ -46,6 +46,7 @@ builder.Services.AddSingleton(builder.Configuration); builder.Services.AddScoped(); builder.Services.AddControllers(); +builder.Services.AddHttpLogging(o => { }); // Learn more about configuring Swagger/OpenAPI at https://aka.ms/aspnetcore/swashbuckle builder.Services.AddEndpointsApiExplorer(); builder.Services.AddSwaggerGen(options => @@ -72,26 +73,27 @@ builder.Services.AddSwaggerGen(options => options.IncludeXmlComments(Path.Combine(AppContext.BaseDirectory, xmlFilename)); }); -var app = builder.Build(); -using (var scope = app.Services.CreateScope()) -{ - var db = scope.ServiceProvider.GetRequiredService(); - var guhf = scope.ServiceProvider.GetRequiredService(); - - var seeder = new Seed(db, guhf); - await seeder.SeedAsync(); +var app = builder.Build(); +using (var scope = app.Services.CreateScope()) +{ + var db = scope.ServiceProvider.GetRequiredService(); + var guhf = scope.ServiceProvider.GetRequiredService(); + + var seeder = new Seed(db, guhf); + await seeder.SeedAsync(); } // Configure the HTTP request pipeline. if (app.Environment.IsDevelopment()) { + app.UseHttpLogging(); app.UseMigrationsEndPoint(); app.UseSwagger(); app.UseSwaggerUI(); } app.UseHttpsRedirection(); - +app.UseCors(); app.UseAuthentication(); app.UseAuthorization(); diff --git a/appsettings.Development.json b/appsettings.Development.json index 0c208ae..42340ce 100644 --- a/appsettings.Development.json +++ b/appsettings.Development.json @@ -2,7 +2,8 @@ "Logging": { "LogLevel": { "Default": "Information", - "Microsoft.AspNetCore": "Warning" + "Microsoft.AspNetCore": "Information" } - } + }, + "Microsoft.AspNetCore.HttpLogging.HttpLoggingMiddleware": "Information" }