Important
Use of OpenTelemetry is recommended for instrumentation, including logging. This library is provided for convenience and compatibility with existing applications but is no longer actively maintained and not recommended for new projects.
This library provides convenience extensions and logic for registering Serilog in applications with support for various hosts while setting up basic thins to match the default logging setup in the framework.
This includes:
- Destructuring is enabled/added by default
- Sensitive data masking is enabled/added by default.
- Console and Debug are registered by default.
- Enrichment of the current environment based on
IHostEnvironment
- Conversion of log levels hence you can continue to use the
Logging
section. - SEQ is added by default when
Logging:Seq:ServerUrl
orSeq:ServerUrl
configuration is available. (UseLogging:Seq:ApiKey
orSeq:ApiKey
to set the key). - Registration via
IServiceCollection
andIHostBuilder
(with the defaults above)
Consult the sample or the builder for more on how to use or what happens underneath.