Skip to content

armgit / ente

Public Imported from GitHub
0

πŸ’š End-to-end encrypted cloud for everything.

[server] Read ENTE_LOG_LEVEL env var

martinmla38999726e0d
diff --git a/server/cmd/museum/main.go b/server/cmd/museum/main.go
index fbb6a2d2ba..704021e11e 100644
--- a/server/cmd/museum/main.go
+++ b/server/cmd/museum/main.go
@@ -1149,6 +1149,9 @@ func setupLogger(environment string) {
Compress: true,
})
}
+ if level, err := log.ParseLevel(viper.GetString("log-level")); err == nil {
+ log.SetLevel(level)
+ }
}
func setupDatabase() *sql.DB {
diff --git a/server/configurations/local.yaml b/server/configurations/local.yaml
index 9c3a2d40c4..893d4da909 100644
--- a/server/configurations/local.yaml
+++ b/server/configurations/local.yaml
@@ -69,6 +69,13 @@
# It must be specified if running in a non-local environment.
log-file: ""
+# The minimum level of logs to emit: "panic", "fatal", "error", "warn", "info",
+# "debug" or "trace".
+#
+# Anything below the configured level is dropped, e.g. "warn" suppresses info
+# and debug logs. If not specified or invalid defaults to "info".
+#log-level: info
+
# HTTP connection parameters
http:
# The port to bind to.