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:
- app config:
"Serilog": {
"levelSwitches": {
"$logLevelSwitch": "Debug"
},
"MinimumLevel": {
"controlledBy": "$logLevelSwitch"
...
- 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"