fix: log path error caused by multi log params #301

close #301
This commit is contained in:
Jacky 2024-02-19 10:59:42 +08:00
parent 99da617d61
commit fdaa11872a

View file

@ -13,6 +13,7 @@ import (
"io" "io"
"net/http" "net/http"
"os" "os"
"strings"
) )
const ( const (
@ -143,7 +144,11 @@ func getLogPath(control *controlStruct) (logPath string, err error) {
return return
} }
logPath = directive.Params // fix: access_log /var/log/test.log main;
p := strings.Split(directive.Params, " ")
if len(p) > 0 {
logPath = p[0]
}
case "error": case "error":
path := nginx.GetErrorLogPath() path := nginx.GetErrorLogPath()