https://github.com/nkz-soft/nkzsoft.service.configuration.logger
A simple logger based on Serilog
https://github.com/nkz-soft/nkzsoft.service.configuration.logger
dotnet-core logging serilog
Last synced: 8 months ago
JSON representation
A simple logger based on Serilog
- Host: GitHub
- URL: https://github.com/nkz-soft/nkzsoft.service.configuration.logger
- Owner: nkz-soft
- License: mit
- Created: 2022-09-15T14:51:09.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-09T04:47:03.000Z (11 months ago)
- Last Synced: 2025-01-11T14:45:35.984Z (10 months ago)
- Topics: dotnet-core, logging, serilog
- Language: C#
- Homepage:
- Size: 45.9 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# NKZSoft.Service.Configuration.Logger
[](https://www.nuget.org/packages/NKZSoft.Service.Configuration.Logger/)
NKZSoft.Service.Configuration.Logger is a simple logger based on [Serilog](https://github.com/serilog/serilog) to use with a microservice architecture.
## Using
```csharp
services.AddLogging(Configuration)
```
It's supported to pass CorrelationId through the [header](https://github.com/nkz-soft/NKZSoft.Service.Configuration.Logger/blob/092ae0a287b0718306b541c8daa23b9ab80a01d9/src/NKZSoft.Service.Configuration.Logger/Constants.cs#L7).
You can [configure](https://github.com/serilog-contrib/Serilog.Enrichers.Sensitive#json-configuration) the Serilog.Enrichers.Sensitive enricher through appsettings.json
```json
{
"Serilog": {
"Using": [
"Serilog.Enrichers.Sensitive"
],
"Enrich": [
{
"Name": "WithSensitiveDataMasking",
"Args": {
"options": {
"MaskValue": "CUSTOM_MASK_FROM_JSON",
"ExcludeProperties": [
"email"
],
"Mode": "Globally"
}
}
}
]
}
}
```