Mert Özen Further With Every Line

Blog

Mert Özen's blog posts on software development, backend, frontend, and DevOps.

Series
.NET Core Web API 36 Angular 31 JavaScript Basics 19 JavaScript Intermediate 18 JavaScript Advanced 16 TypeScript Basics 14 TypeScript Intermediate 14 TypeScript Advanced 12 Entity Framework Core 28 Dapper 16 Git & GitHub 29 Web Security (OWASP Top 10) 21 LLM Fundamentals 20 C# Fundamentals 20 Object-Oriented Programming in C# 16 C# Collections and Generics 11 LINQ 17 Asynchronous Programming in C# 17 Advanced C# 14 C# Versions 6 Solution Patterns 22 SOLID and Design Principles 12 Clean Code 13 Design Patterns 23 UML and Modeling 18 Introduction to Software Architecture 9 Clean, Onion and Hexagonal Architecture 8 Vertical Slice Architecture 6 Domain-Driven Design 12 CQRS and Event Sourcing 10 Messaging and Event-Driven Architecture 9 Modular Monolith 2 Microservices 10 UI Architecture Patterns 9 Architecture Decisions 7 System Design 15 Distributed Systems Fundamentals 11 Background Jobs and Scheduled Jobs 11 Working with Message Queues 14 Logging in .NET 10 Caching 10 Real-time Applications 9 ASP.NET Core MVC and Razor Pages 13 CI/CD Fundamentals 8 GitHub Actions 16 Jenkins 12 Web Servers and Hosting 12 Deployment Strategies 9 Kubernetes 19 Authentication and Authorization 18 ASP.NET Core Security 8 Frontend Security 9 API Security (OWASP API Top 10) 11 AI with .NET 14 RAG 13 AI Agents and MCP 14 Test Strategy 4 Unit Testing 13 SDLC (Software Development Life Cycle) 6 Agile Mindset 6 Scrum 11 Kanban 7 Introduction to Product Management 9 SEO Fundamentals 7 Technical SEO 12 GEO (Generative Engine Optimization) 7 Algorithms and Data Structures 22 Debugging and Problem Solving 13
10 posts found #backend
What to Log and What Not To: A Logging Strategy for .NET and the Anatomy of a Good Log Event
Backend PART 01

What to Log and What Not To: A Logging Strategy for .NET and the Anatomy of a Good Log Event

A good log event is a single occurrence that answers its reader's question: it has a constant message template, meaningful property names and an EventId. We turn five bad log lines in the Bookstore order flow into three events and show level choice, double-logged exceptions and the cost of interpolation caught by CA2254 with real output.

8 Nov 2026 12 min 4
High-Performance Logging: the LoggerMessage Source Generator, IsEnabled and Allocation Cost
Backend PART 02

High-Performance Logging: the LoggerMessage Source Generator, IsEnabled and Allocation Cost

Even a disabled LogDebug line allocates 128 bytes per call because of params object[] and boxing; the [LoggerMessage] source generator brings that to zero with typed parameters and an IsEnabled check. BenchmarkDotNet measurements, an event catalog, primary constructors, [LogProperties] and the cost of the Telemetry package swapping the generator.

8 Nov 2026 12 min 4
Serilog in Depth: Bootstrap Logger, appsettings Configuration, Enrichers and Request Logging
Backend PART 03

Serilog in Depth: Bootstrap Logger, appsettings Configuration, Enrichers and Request Logging

A production-ready Serilog setup has two stages: a bootstrap logger that catches startup failures, then the real logger fed by appsettings and DI. ReadFrom.Configuration, a custom enricher, PushProperty versus BeginScope, UseSerilogRequestLogging writing one summary event per request, and the logs lost when CloseAndFlush is forgotten.

8 Nov 2026 12 min 4
Serilog Sinks: Console, File, Seq and OpenTelemetry — Async, Batching and Lost Logs
Backend PART 04

Serilog Sinks: Console, File, Seq and OpenTelemetry — Async, Batching and Lost Logs

In a container, logs go to stdout as compact JSON; if you need files, set rolling and retention explicitly. Serilog 4's core batching and the async wrapper either drop events or hold the app when a sink is slow: 101 of 2,000 events arrived, or the loop took 2.4 seconds. SelfLog, going out to OTLP and per-sink levels.

8 Nov 2026 11 min 5
Reading Structured Logs with Seq: Docker Setup, Queries, Signals and Alerts
Backend PART 05

Reading Structured Logs with Seq: Docker Setup, Queries, Signals and Alerts

We run Seq in Docker with a password and a separate ingestion port, and send logs through Serilog and OTLP with an Ingest-only API key. Filters, group by and percentile queries, logs and spans on the same TraceId, signals, alerts and signal-based retention, all with real results, including why 8 failures became 16 events and the ERROR level trap with OTLP.

8 Nov 2026 12 min 5
Correlation IDs and Trace Context: Linking Every Log of a Request from the API to the Queue
Backend PART 06

Correlation IDs and Trace Context: Linking Every Log of a Request from the API to the Queue

The way to link every log of a request is to write the TraceId from the W3C traceparent on every log line. ASP.NET Core and HttpClient do it on their own; across a queue and a BackgroundService the chain breaks and must be carried manually with DistributedContextPropagator. ActivityTrackingOptions, Serilog, baggage, X-Correlation-ID, a support code on the error screen and one Seq query, with real output.

8 Nov 2026 10 min 5
Sensitive Data in Logs: Redaction, Data Classification and Privacy-Compliant Logging
Backend PART 07

Sensitive Data in Logs: Redaction, Data Classification and Privacy-Compliant Logging

The way to keep sensitive data out of logs is to classify it and mask it automatically in the logging pipeline. Taxonomy and attributes with Microsoft.Extensions.Compliance.Redaction, [LogProperties], ErasingRedactor, your own redactor and the HMAC redactor that keeps correlation; masking with destructuring in Serilog, personal data in exception messages and a FakeLogger test that catches it, with real output.

8 Nov 2026 11 min 4
HTTP Logging in ASP.NET Core: AddHttpLogging, the W3C Logger and the Cost of Request/Response Bodies
Backend PART 08

HTTP Logging in ASP.NET Core: AddHttpLogging, the W3C Logger and the Cost of Request/Response Bodies

Use HTTP logging in production with one event per request, bodies off, and an interceptor that logs the body only on errors. The real defaults of AddHttpLogging, the header allow list, CombineLogs, [HttpLogging] and WithHttpLogging, an IHttpLoggingInterceptor that logs bodies on 4xx/5xx, the W3C logger file and the measured cost of body logging: 85 KB of allocations per request instead of 8 KB.

8 Nov 2026 9 min 3
Log Levels and Cost: Sampling, Buffering and Changing Log Levels Live in Production
Backend PART 09

Log Levels and Cost: Sampling, Buffering and Changing Log Levels Live in Production

Log volume is set by your level configuration: the same 1000 requests produced 6.3 MB of logs at Debug and 246 KB at Information with Microsoft.AspNetCore=Warning. With real output we show random and trace-based sampling in Microsoft.Extensions.Telemetry, per-request buffering that writes Debug logs on failure, changing levels without a restart, and how sampling can drop Errors and buffers lose scopes and TraceId.

8 Nov 2026 12 min 4
What's New in Logging from .NET 8 to .NET 11: Enrichment, Redaction, FakeLogger, Buffering and Generic LoggerMessage
Backend PART 10

What's New in Logging from .NET 8 to .NET 11: Enrichment, Redaction, FakeLogger, Buffering and Generic LoggerMessage

Logging in .NET moves on two trains: ILogger and the source generator ship with the runtime, while enrichment, redaction, FakeLogger, sampling and buffering come with the monthly Microsoft.Extensions.Telemetry packages. With real output we show which feature arrived when, CA1873 and the obsolete AddServiceLogEnricher in .NET 10, generic LoggerMessage in .NET 11, and how to read old Serilog Startup code.

8 Nov 2026 12 min 4
Blog Map