From 4f0d801b64d2ea9d62f3e33960c350a18b5827b8 Mon Sep 17 00:00:00 2001 From: Enrico Stahn Date: Tue, 20 Feb 2018 13:43:52 +1100 Subject: [PATCH] Set log level from environment variable PHP_FPM_LOG_LEVEL --- cmd/root.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cmd/root.go b/cmd/root.go index 50aa520..d19e5c4 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -89,6 +89,10 @@ func initConfig() { func initLogger() { phpfpm.SetLogger(log) + if value := os.Getenv("PHP_FPM_LOG_LEVEL"); value != "" { + logLevel = value + } + lvl, err := logrus.ParseLevel(logLevel) if err != nil { lvl = logrus.InfoLevel