Set log level from environment variable PHP_FPM_LOG_LEVEL

This commit is contained in:
Enrico Stahn 2018-02-20 13:43:52 +11:00
parent 695caeeb25
commit 4f0d801b64
No known key found for this signature in database
GPG key ID: 5263621C269A50DE

View file

@ -89,6 +89,10 @@ func initConfig() {
func initLogger() { func initLogger() {
phpfpm.SetLogger(log) phpfpm.SetLogger(log)
if value := os.Getenv("PHP_FPM_LOG_LEVEL"); value != "" {
logLevel = value
}
lvl, err := logrus.ParseLevel(logLevel) lvl, err := logrus.ParseLevel(logLevel)
if err != nil { if err != nil {
lvl = logrus.InfoLevel lvl = logrus.InfoLevel