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

Configurable backend log level #2533

Merged
merged 2 commits into from
Jun 27, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions deploy/development.rc.template
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@
# Note: stand-up-dev-env.sh will try to use it if it's present.


# Enable Debug logging for Jetstream
#export LOG_LEVEL=debug

###################
# Corporate Proxy #
###################
Expand Down
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 }}
{{- if .Values.console.backendLogLevel }}
- name: LOG_LEVEL
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
2 changes: 1 addition & 1 deletion deploy/proxy.env
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,4 @@ ALLOWED_ORIGINS=http://nginx
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
ENCRYPTION_KEY=B374A26A71490437AA024E4FADD5B497FDFF1A8EA6FF12F6FB65AF2720B59CCF
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