mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-09-10 00:31:35 +08:00
feat(website): Optimize website error_log configuration (#7173)
Refs **https://github.com/1Panel-dev/1Panel/issues/7161**
This commit is contained in:
parent
7dc0a2f664
commit
7b1d746ce7
1 changed files with 6 additions and 6 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue