diff --git a/cmd/server/main.go b/cmd/server/main.go index 8bb7d8a..2280878 100644 --- a/cmd/server/main.go +++ b/cmd/server/main.go @@ -10,6 +10,7 @@ import ( func main() { // grab the environment variables from the runtime environment + // unfortunately since its before we configure the loglevel, we cannot use slog logging in those functions env := utility.GrabEnvironment() // configure the logger so we have nice json level := utility.ParseSlogLevel(env.LogLevel) // defaults to Info @@ -19,7 +20,7 @@ func main() { slog.SetDefault(logger) // print our running environment variable set - slog.Debug("environment", "env", env) + slog.Debug("displaying environment", "env", env) // TO DO, allow cmd args parsing diff --git a/internal/utility/environment.go b/internal/utility/environment.go index 41f1470..f2154e2 100644 --- a/internal/utility/environment.go +++ b/internal/utility/environment.go @@ -80,7 +80,7 @@ func GrabEnvironment() Environment { // Basic server configuration Version: safeStringGrab("VERSION", "0.0.1"), Codename: safeStringGrab("CODENAME", "Magical Anomaly"), - LogLevel: safeStringGrab("LOG_LEVEL", "info"), + LogLevel: safeStringGrab("LOG_LEVEL", "debug"), // GIN API configuration DataDirectory: safeStringGrab("DATA_DIR", fbBase),