mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2026-02-04 14:33:01 +08:00
feat(website): Optimize website error_log configuration (#7173)
Refs **https://github.com/1Panel-dev/1Panel/issues/7161**
This commit is contained in:
@@ -1052,19 +1052,19 @@ func (w WebsiteService) OpWebsiteLog(req request.WebsiteLogReq) (*response.Websi
|
||||
res.Content = strings.Join(lines, "\n")
|
||||
return res, nil
|
||||
case constant.DisableLog:
|
||||
key := "access_log"
|
||||
params := dto.NginxParam{}
|
||||
switch req.LogType {
|
||||
case constant.AccessLog:
|
||||
params.Name = "access_log"
|
||||
params.Params = []string{"off"}
|
||||
website.AccessLog = false
|
||||
case constant.ErrorLog:
|
||||
key = "error_log"
|
||||
params.Name = "error_log"
|
||||
params.Params = []string{"/dev/null", "crit"}
|
||||
website.ErrorLog = false
|
||||
}
|
||||
var nginxParams []dto.NginxParam
|
||||
nginxParams = append(nginxParams, dto.NginxParam{
|
||||
Name: key,
|
||||
Params: []string{"off"},
|
||||
})
|
||||
nginxParams = append(nginxParams, params)
|
||||
|
||||
if err := updateNginxConfig(constant.NginxScopeServer, nginxParams, &website); err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user