Логирование с Serilog: как повысить отказоустойчивость и скорость

Когда логов становится слишком много, а сеть или облачный приёмник начинает тормозить, даже самый надёжный логгер может превратиться в источник проблем. Наша команда столкнулась с тем, что память забивалась логами, и это приводило к OutOfMemoryException и аварийному закрытию приложений. В статье разбираю, как устроен процесс логирования в Serilog, почему асинхронная отправка логов не всегда безопасна, как протестировать систему на устойчивость к задержкам и какие настройки и архитектурные приёмы помогут сохранить стабильность под нагрузкой.

https://habr.com/ru/articles/972118/

#serilog #altenar #c# #net #логирование #spbdotnet

Логирование с Serilog: как повысить отказоустойчивость и скорость

Меня зовут Владимир Куропатка, и я старший бэкенд-разработчик в компании Altenar, которая поставляет ПО для зарубежных лицензированных операторов прогнозов на спорт. Наша команда столкнулась с тем,...

Хабр

@nblumhardt Look, #JetBrainsRider learned a new #OpenTelemetry trick and it works pretty well with #SeriLog
I wish there would be a similar @seq plugin for Rider that would just spin up a local dev Seq instance for me and sow the logs directly in the IDE.

https://github.com/bitbonk/OTELSerilogDemo

#dotnet #o11y #observability #dotnet

GitHub - bitbonk/OTELSerilogDemo: Open Telemetry with Serilog Demo

Open Telemetry with Serilog Demo. Contribute to bitbonk/OTELSerilogDemo development by creating an account on GitHub.

GitHub
Milan Jovanović with a simple and effective way to add additional context to OpenTelemetry request tracing https://www.milanjovanovic.tech/blog/better-request-tracing-with-user-context-in-asp-net-core #dotnet #aspnet #otel #serilog
Better Request Tracing with User Context in ASP.NET Core

Adding user context to request tracing in ASP.NET Core helps track issues and understand user behavior. This article shows how to implement middleware that enriches logs with user IDs for better troubleshooting and performance monitoring.

Blogged: .NET Azure Functions in isolated-worker model, Serilog and App Insights.

https://david.gardiner.net.au/2025/02/functions-serilog-appinsights.html

#AzureFunctions #Serilog #Logging

.NET Azure Functions, Isolated worker model, Serilog to App Insights

There's already some good resources online about configuring .NET Azure Functions with Serilog. For example, Shazni gives a good introduction to Serilog and then shows how to configure for in-process and isolated Azure Functions, and Simon shows how to use Serilog with Azure Functions in isolated worker model, but neither cover using App Insights.

David Gardiner
Release v4.2.0 · serilog/serilog

What's Changed #2141 — stabilize and fully implement dotted identifiers in message templates (@nblumhardt) #2028 — use RuntimeHelpers.GetHashCode() in message template cache comparer (@sungam3r) #...

GitHub
@nblumhardt I am using Microsoft.Extension.Logging and System.Diagnostics.Activity for logging and #Serilog just for the sinks. Now I would like to log to #Seq (`WriteTo.Seq()`) and also enable traces and spans. Is there a place where I can see/learn how to do this?
Quick blog article, On Logging; just a quick post about choosing logging strageies in different environments (and
some discussion on WHY you log differently in different circumstances) https://www.mostlylucid.net/blog/onlogging
#aspnetcore #serilog
On Logging in ASP.NET Applications (Part 1...probably) (English)

Scott Galloway is a lead developer and software engineer with a passion for building web applications.

Following yesterday's write-up of #Serilog 4.1 fallback sinks, here's a tiny test harness you can use to explore the new batch retry algorithm, along with an example run: https://nblumhardt.com/2024/10/retry-time-limit/
Visualizing the Serilog 4.1 batch retry algorithm

This is a quick post exploring how Serilog 4.1 (currently in preview) schedules retries when logging fails.

Serilog fallback sinks and failure listeners: https://nblumhardt.com/2024/10/fallback-logging/ #serilog
Serilog fallback sinks

Currently in preview, Serilog 4.1 adds support for falling back to a second sink when the first sink fails. This scenario shows up in a few variations, usual...

Today's second blog post. Seq for ASP.NET Logging - Tracing with SerilogTracing
https://www.mostlylucid.net/blog/selfhostingseqpt2
#seq #serilog #aspnetcore
Seq for ASP.NET Logging - Tracing with SerilogTracing (English)

Scott Galloway is a lead developer and software engineer with a passion for building web applications.