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

Unable to override log level switch initial log level via environment variables #231

Closed
frolyo opened this issue Aug 19, 2020 · 0 comments · Fixed by #242
Closed

Unable to override log level switch initial log level via environment variables #231

frolyo opened this issue Aug 19, 2020 · 0 comments · Fixed by #242

Comments

@frolyo
Copy link

frolyo commented Aug 19, 2020

Since we deploy our services in k8s we need to override level switch initial log level via environment variable. At the same time levelSwitchName must start with $ sign which is not allowed for env variable name.

How can initialLevel can be overriden?

Example:

  1. app config:
  "Serilog": {
    "levelSwitches": {
      "$logLevelSwitch": "Debug"
    },
    "MinimumLevel": {
      "controlledBy": "$logLevelSwitch"
...
  1. override:
env:
  name: serilog_levelSwitches_$logLevelSwitch
  value: Debug

Error:
"Invalid value: "serilog__levelSwitches__$logLevelSwitch": a valid environment variable name must consist of alphabetic characters, digits, '_', '-', or '.', and must not start with a digit"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants