Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #149 -- Add levelSwitch to config #159

Merged
merged 1 commit into from
May 1, 2022

Conversation

jotabe-net
Copy link

The sink configuration extension methods missed a "levelSwitch" parameter. I included it, as an optional parameter, in all the extension methods.

I deployed locally a package with this update and tested the behavior, and everything looks fine.

I did the testing on a full .NET Framework Web API app, with a JSON config file, and it works. Should work exactly in the same way in .NET Core. Relevant part of the configuration:

"Serilog": {
  "Using": [ "Serilog.Sinks.File", "Serilog.Sinks.ApplicationInsights" ],
    "LevelSwitches": {
      "$aiLevelSwitch": "Information"
    },
    "WriteTo": [
      {
        "Name": "ApplicationInsights",
        "Args": {
          "telemetryConverter": "Serilog.Sinks.ApplicationInsights.Sinks.ApplicationInsights.TelemetryConverters.TraceTelemetryConverter, Serilog.Sinks.ApplicationInsights",
          "levelSwitch": "$aiLevelSwitch"
        }
      }
    ]

@nblumhardt nblumhardt changed the base branch from main to dev May 1, 2022 23:13
@nblumhardt
Copy link
Contributor

Thanks, LGTM 👍

@nblumhardt nblumhardt merged commit 06d063f into serilog-contrib:dev May 1, 2022
@nblumhardt nblumhardt mentioned this pull request Jun 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants