Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Core
  3. Serilog.Exceptions

Serilog.Exceptions

MITC#8.4.0

A Serilog enricher that logs exception details and custom properties not included in Exception.ToString().

GitHubGitHub
537 stars53 forks0 contributors

What is Serilog.Exceptions?

Serilog.Exceptions is a Serilog enricher library for .NET that captures and logs detailed exception information and custom properties not included in the standard `Exception.ToString()` output. It solves the problem of missing critical debugging data in structured logs, such as nested validation errors in Entity Framework exceptions. By providing deep destructuring of exceptions, it ensures developers have complete visibility into failures.

Target Audience

.NET developers using Serilog for structured logging who need comprehensive exception details for debugging complex applications, particularly those working with databases, web APIs, or microservices.

Value Proposition

Developers choose Serilog.Exceptions because it fills a critical gap in Serilog's default logging by extracting hidden exception properties essential for debugging, does so with minimal performance impact using optimized destructurers, and offers extensibility for custom and third-party exceptions through a modular package ecosystem.

Overview

Log exception details and custom properties that are not output in Exception.ToString().

Use Cases

Best For

  • Logging Entity Framework validation errors with full detail
  • Capturing custom properties from domain-specific exceptions
  • Enhancing structured logs for microservices debugging
  • Avoiding reflection overhead for common SQL and gRPC exceptions
  • Filtering out redundant or sensitive exception properties
  • Integrating detailed exception logging with JSON-based log sinks

Not Ideal For

  • Projects not using Serilog as their logging framework
  • Applications with stringent log storage constraints where detailed exception data could excessively increase volume
  • Teams unwilling to manage additional NuGet dependencies for library-specific destructurers (e.g., Entity Framework Core, SQL Server)

Pros & Cons

Pros

Deep Exception Destructuring

Logs nested custom properties from exceptions like DbEntityValidationException that are missing from standard ToString(), as shown in the README's JSON example with EntityValidationErrors.

Performance Optimized

Uses custom destructurers for common exception types to minimize reflection overhead, falling back only for unsupported types, with reflection operations cached per exception-type.

Extensible Architecture

Supports custom destructurers for user-defined exceptions and offers additional NuGet packages for libraries like Entity Framework Core, SQL Server, and gRPC to avoid reflection.

Configurable Filtering

Allows filtering of properties like StackTrace and TargetSite to avoid duplication or sensitive data logging, using built-in or custom IExceptionPropertyFilter implementations.

Cons

Risk of Data Exposure

The README warns that without proper configuration, Entity Framework exceptions can log entire database schemas (e.g., via IQueryable properties), posing a security risk that requires additional destructurers to mitigate.

Dependency Management Overhead

Optimal performance requires installing separate NuGet packages for specific exception types (e.g., Serilog.Exceptions.EntityFrameworkCore), adding to project complexity and maintenance.

Configuration Complexity

Setting up sinks to output enriched properties (e.g., adding {Properties:j} to templates) and configuring destructurers involves extra steps beyond basic Serilog setup, which can be error-prone.

Frequently Asked Questions

Quick Stats

Stars537
Forks53
Contributors0
Open Issues14
Last commit19 days ago
CreatedSince 2015

Tags

#nuget#exception#csharp#nuget-package#dotnet#dotnet-core#logging#structured-logging#exception-handling#reflection#serilog#c-sharp#diagnostics

Included in

Core21.2k
Auto-fetched 10 hours ago

Related Projects

SerilogSerilog

Simple .NET logging with fully-structured events

Stars7,959
Forks854
Last commit5 days ago
NLogNLog

NLog - Flexible and Structured Logging for various .NET Platforms

Stars6,537
Forks1,386
Last commit22 hours ago
serilog-aspnetcoreserilog-aspnetcore

Serilog integration for ASP.NET Core

Stars1,420
Forks212
Last commit5 months ago
log4netlog4net

Apache Log4net is a versatile, feature-rich, efficient logging API and backend for .NET

Stars927
Forks336
Last commit17 hours ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub