{"repo":"RehanSaeed/Serilog.Exceptions","free":true,"listed":false,"github":"https://github.com/RehanSaeed/Serilog.Exceptions","clone":"git clone https://github.com/RehanSaeed/Serilog.Exceptions.git","description":"Log exception details and custom properties that are not output in Exception.ToString().","language":"C#","stars":538,"topics":["serilog","nuget","logging","exception","reflection","dotnet","dotnet-core","c-sharp"],"license":"MIT","category":"analytics","readme_excerpt":"Serilog.Exceptions is an add-on to Serilog to log exception details and custom properties that are not output in Exception.ToString() . What Does It Do? Your JSON logs will now be supplemented with detailed exception information and even custom exception properties. Here is an example of what happens when you log a DbEntityValidationException from EntityFramework (This exception is notorious for having deeply nested custom properties which are not included in the .ToString() ). The code above logs the following: Getting Started Warning Entity Framework Core Users: If you are using Entity Framework with Serilog.Exceptions you should read the following instructions. Add the Serilog.Exceptions NuGet package to your project using the NuGet Package Manager or run the following command in the Package Console Window: When setting up your logger, add the WithExceptionDetails() line like so: Make sure that the sink's formatter outputs enriched properties. Serilog.Sinks.Console and many more do not do that by default. You may need to add {Properties:j} to your sink's format template. For example, configuration for console sink may look like that: JSON appSettings.json configuration Alternatively to fluent configuration setting can be stored in application configuration using Serilog.Settings.Configuration : Performance This library has custom code to deal with extra properties on most common exception types and only falls back to using reflection to get the extra information if the exc","default_branch":null,"files":null,"tree":[],"storefront":"/r/RehanSaeed","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/RehanSaeed/Serilog.Exceptions/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}