Jason
11/21/2025, 1:05 PMMike Chambers
11/24/2025, 9:46 AMapplication insights or seq?
So we could mitigate some of the IO by disabling or curtailing the Native filesystem logging, (appsetting below)?
Also with serilog (asp.net) we can utilise the provided RequestLogging middleware to make serilog less chatty... Basically squashing multiple logs into a single request entry with all the same info as the multiple entries that would have occurred (the IDiagnosticContext allows you to tailor to your own needs) https://github.com/serilog/serilog-aspnetcore?tab=readme-ov-file#request-logging
json
"Serilog": {
"MinimumLevel": {
//Verbose|Debug|Information|Warning|Error|Fatal
"Default": "Information",
"Override": {
"Microsoft": "Warning",
"SixLabors.ImageSharp": "Warning"
}
},
"WriteTo": [
{
"Name": "Async",
"Args": {
"configure": [
{
"Name": "Seq",
"Args": {
"serverUrl": "XXXXX",
"apiKey": "XXXXX",
"restrictedToMinimumLevel": "Information"
}
}
]
}
},
{
// can't place in async as UmbracoFile isn't a real sink implementation...
"Name": "UmbracoFile",
"Args": {
"RestrictedToMinimumLevel": "Fatal"
}
}
]
},Mike Chambers
11/24/2025, 10:07 AMIDiagnosticContext
csharp
public class SerilogRequestLoggingComposer : IComposer
{
// can move to prePipeline if we want to log static files.
// in 13.1.1 can move to preRouting for just after static files
public void Compose(IUmbracoBuilder builder)
{
builder.Services.AddControllers(opts => opts.Filters.Add<SerilogLoggingActionFilter>());
builder.Services.Configure<UmbracoPipelineOptions>(options =>
options.AddFilter(
new UmbracoPipelineFilter("SerilogRequestLogging", preRouting: app => app.UseSerilogRequestLogging(opt => opt.EnrichDiagnosticContext = SerilogRequestLoggingOptions.EnrichFromRequest))
)
);
}
}Jason
11/24/2025, 10:56 AMJason
11/24/2025, 10:58 AM