Skip to content
This repository has been archived by the owner on Jan 24, 2023. It is now read-only.

Commit

Permalink
Configurable backend log level
Browse files Browse the repository at this point in the history
  • Loading branch information
Irfan Habib committed Jun 27, 2018
1 parent f53dbcf commit 0769447
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions deploy/kubernetes/console/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,10 @@ spec:
{{- if .Values.socksProxy }}
value: {{.Values.socksProxy}}
{{- end }}
- name: LOG_LEVEL
{{- if .Values.console.backendLogLevel }}
value: {{.Values.console.backendLogLevel}}
{{- end }}
{{- if or .Values.env.UAA_HOST .Values.env.DOMAIN }}
- name: UAA_ENDPOINT
value: {{ template "scfUaaEndpoint" . }}
Expand Down
1 change: 1 addition & 0 deletions deploy/kubernetes/console/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ console:
port: 443
cookieDomain:
# externalIP: 127.0.0.1
backendLogLevel: info
images:
console: stratos-console
proxy: stratos-jetstream
Expand Down
1 change: 1 addition & 0 deletions deploy/proxy.env
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ SESSION_STORE_SECRET=wheeee!
CONSOLE_PROXY_CERT_KEY=use local dev-cert/pproxy.key in portal-proxy repo
CONSOLE_PROXY_CERT=use local dev-cert/pproxy.crt in portal-proxy repo
ENCRYPTION_KEY=B374A26A71490437AA024E4FADD5B497FDFF1A8EA6FF12F6FB65AF2720B59CCF
LOG_LEVEL=debug
6 changes: 6 additions & 0 deletions src/backend/app-core/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,12 @@ func main() {
if err != nil {
log.Fatal(err) // calls os.Exit(1) after logging
}
if portalConfig.LogLevel != "" {
log.Infof("Setting log level to: %s", portalConfig.LogLevel)
level, _ := log.ParseLevel(portalConfig.LogLevel)
log.SetLevel(level)
}

log.Info("Configuration loaded.")
isUpgrading := isConsoleUpgrading()

Expand Down
3 changes: 2 additions & 1 deletion src/backend/app-core/repository/interfaces/structs.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,9 @@ type PortalConfig struct {
EncryptionKeyFilename string `configName:"ENCRYPTION_KEY_FILENAME"`
EncryptionKey string `configName:"ENCRYPTION_KEY"`
AutoRegisterCFUrl string `configName:"AUTO_REG_CF_URL"`
SSOLogin bool `configName:"SSO_LOGIN"`
SSOLogin bool `configName:"SSO_LOGIN"`
CookieDomain string `configName:"COOKIE_DOMAIN"`
LogLevel string `configName:"LOG_LEVEL"`
CFAdminIdentifier string
CloudFoundryInfo *CFInfo
HTTPS bool
Expand Down

0 comments on commit 0769447

Please sign in to comment.