Skip to content

Commit

Permalink
feat(website): Optimize website error_log configuration (#7173)
Browse files Browse the repository at this point in the history
Refs **#7161
  • Loading branch information
zhengkunwang223 authored Nov 25, 2024
1 parent 7dc0a2f commit 7b1d746
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions backend/app/service/website.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 7b1d746

Please sign in to comment.