Skip to content

nkz-soft/NKZSoft.Service.Configuration.Logger

Repository files navigation

NKZSoft.Service.Configuration.Logger

Nuget

NKZSoft.Service.Configuration.Logger is a simple logger based on Serilog to use with a microservice architecture.

Using

services.AddLogging(Configuration)

It's supported to pass CorrelationId through the header.

You can configure the Serilog.Enrichers.Sensitive enricher through appsettings.json

{
  "Serilog": {
    "Using": [
      "Serilog.Enrichers.Sensitive"
    ],
    "Enrich": [
      {
        "Name": "WithSensitiveDataMasking",
        "Args": {
          "options": {
            "MaskValue": "CUSTOM_MASK_FROM_JSON",
            "ExcludeProperties": [
              "email"
            ],
            "Mode": "Globally"
          }
        }
      }
    ]
  }
}