“集群设置 -- 网站设置”增加“允许记录访问日志”选项

This commit is contained in:
GoEdgeLab
2023-07-05 15:29:26 +08:00
parent 0a2e1759a4
commit 1042c8e560
2 changed files with 6 additions and 1 deletions

View File

@@ -14,6 +14,11 @@ const (
// 日志
func (this *HTTPRequest) log() {
// 检查全局配置
if this.nodeConfig != nil && this.nodeConfig.GlobalServerConfig != nil && !this.nodeConfig.GlobalServerConfig.HTTPAccessLog.IsOn {
return
}
var ref *serverconfigs.HTTPAccessLogRef
if !this.forceLog {
if this.disableLog {

View File

@@ -197,7 +197,7 @@ func (this *Node) execGlobalServerConfigChangedTask(rpcClient *rpc.RPCClient) er
return err
}
if len(resp.GlobalServerConfigJSON) > 0 {
var globalServerConfig = serverconfigs.DefaultGlobalServerConfig()
var globalServerConfig = serverconfigs.NewGlobalServerConfig()
err = json.Unmarshal(resp.GlobalServerConfigJSON, globalServerConfig)
if err != nil {
return errors.New("decode global server config failed: " + err.Error())