skip to Main Content

Asp.net – How to make NLog stop writing redundant information?

My Programm.cs: var logger = LogManager.Setup() .RegisterNLogWeb() .LoadConfigurationFromFile("nlog.config") .GetCurrentClassLogger(); try { var builder = WebApplication.CreateBuilder(args); builder.Services.AddControllers(options => { options.Filters.Add<LogResponseFilterAttribute>(); }); builder.Services.AddScoped<LogResponseFilterAttribute>(); builder.Logging.ClearProviders(); builder.Logging.SetMinimumLevel(LogLevel.Information); builder.Host.UseNLog(); var app = builder.Build(); app.UseHttpsRedirection(); app.UseAuthorization(); app.MapControllers(); app.Run(); } catch (Exception e) { logger.Error(e, "Stopped program…

VIEW QUESTION
Back To Top
Search