Skip to content

Commit

Permalink
Added support for setting log level via environment variables.
Browse files Browse the repository at this point in the history
  • Loading branch information
Silvenga committed Oct 5, 2022
1 parent 58f9763 commit f5b88ce
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,9 @@
"CONTRAST_WEBHOOK_HOSTS": "contrast-agent-operator,contrast-agent-operator.contrast-agent-operator.svc,contrast-agent-operator.contrast-agent-operator.svc.cluster.local",
"CONTRAST_DEFAULT_REGISTRY": "contrast",
"CONTRAST_SETTLE_DURATION": "2",
"CONTRAST_DEVELOPMENT": "true"
"CONTRAST_DEVELOPMENT": "true",
"CONTRAST_LOG_LEVEL": "Info",
"DOTNET_GCHeapHardLimit": "402653184" // Mimic a container with a 512Mi limit. That said, not sure if this works.
},
"applicationUrl": "https://localhost:5001"
}
Expand Down
2 changes: 1 addition & 1 deletion src/Contrast.K8s.AgentOperator/nlog.config
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@
<logger name="*" minlevel="Warn" writeTo="TelemetryExceptions" />

<logger name="KubeOps.Operator.Kubernetes.ResourceWatcher" final="true" />
<logger name="*" minlevel="Trace" writeTo="Console" />
<logger name="*" minlevel="${environment:variable=CONTRAST_LOG_LEVEL:whenEmpty=Trace}" writeTo="Console" />
</rules>
</nlog>

0 comments on commit f5b88ce

Please sign in to comment.