Skip to content

Adds support for logging JSON.NET dynamic types as structured data with Serilog

License

Notifications You must be signed in to change notification settings

destructurama/json-net

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Destructurama.JsonNet

License

codecov Nuget Nuget

GitHub Release Date GitHub commits since latest release (by date) Size

GitHub contributors Activity Activity Activity

Run unit tests Publish preview to GitHub registry Publish release to Nuget registry CodeQL analysis

Adds support for logging JSON.NET dynamic types as structured data with Serilog.

Installation

Install from NuGet:

Install-Package Destructurama.JsonNet

Usage

Modify logger configuration:

var log = new LoggerConfiguration()
  .Destructure.JsonNetTypes()
  ...

Any JSON.NET dynamic object can be represented in the log event's properties:

var obj = JsonConvert.DeserializeObject<dynamic>(someJson);
Log.Information("Deserialized {@Obj}", obj);

Benchmarks

The results are available here.

About

Adds support for logging JSON.NET dynamic types as structured data with Serilog

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages