Skip to content

Adds support for logging/destructuring NodaTime types with Serilog

License

Notifications You must be signed in to change notification settings

kingboyk/Serilog.NodaTime

Repository files navigation

Build status Nuget

Serilog.NodaTime

Adds support for logging NodaTime types with Serilog.

Configuration

Configure Serilog to support NodaTime types by calling .ConfigureForNodaTime on the LoggerConfiguration instance:

.ConfigureForNodaTime(DateTimeZoneProviders.Tzdb)

For example:

var logger = new LoggerConfiguration()
                .ConfigureForNodaTime(DateTimeZoneProviders.Tzdb)
                .WriteTo.Console(outputTemplate: "{Instant} {Message:lj}")
                .CreateLogger();

Usage

Please refer to the example program.

About

Adds support for logging/destructuring NodaTime types with Serilog

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages