NightWatchman / Serilog.Enrichers.ExceptionProperties

Enriches Serilog log events by adding exception properties when the log event includes an exception.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Serilog.Enrichers.ExceptionProperties

Enriches Serilog events with Exception properties when Exceptions are logged. The included properties are Message, Stacktrace, and InnerException.Message. They are enhanced as Exception, Stacktrace, and InnerException properties respectively.

To use the enricher, first install the NuGet package:

Install-Package Serilog.Enrichers.ExceptionProperties

Then, apply the enricher to your LoggerConfiguration:

Log.Logger = new LoggerConfiguration()
  .Enrich.WithExceptionProperties()
  // ...other configuration...
  .CreateLogger();

Copyright (c) Eric Rushing 2022 - Provided under the Apache License, Version 2.0.

About

Enriches Serilog log events by adding exception properties when the log event includes an exception.


Languages

Language:C# 100.0%