skip to Main Content

Asp.net – Is it possible to configure serilog to accept specifc logging, even if the severity is below the sink's minimum severity?

This is how my logging in Asp.Net is configured: _ = pServiceCollection.AddSerilog((serviceProvider, loggerConfiguration) => loggerConfiguration.ReadFrom.Configuration(pConfiguration) .ReadFrom.Services(serviceProvider) .Enrich.FromLogContext() .WriteTo.Console(outputTemplate: LogMessageTemplate, formatProvider: CultureInfo.InvariantCulture) .WriteTo.File(path: logFilePath, outputTemplate: LogMessageTemplate, rollingInterval: RollingInterval.Day, retainedFileCountLimit: 30, formatProvider: CultureInfo.InvariantCulture) .WriteTo.EventLog(source: CommonConstants.ProductName, manageEventSource: true, restrictedToMinimumLevel: LogEventLevel.Warning, formatProvider: CultureInfo.InvariantCulture)); Only…

VIEW QUESTION

How to disable Serilog to log one exception? – Asp.net

(Asp.Net core 3.1/.Net 6) I need to disable the ERR logging of exception TaskCanceledException in an Asp.Net application (built by others). I've used the following middleware to suppress the TaskCanceledException app.UseMiddleware<TaskCanceledMiddleware>(); public class TaskCanceledMiddleware { private readonly RequestDelegate _next; public…

VIEW QUESTION
Back To Top
Search