diff --git a/configs/milvus.yaml b/configs/milvus.yaml index d81e61f092..7c47b8f3f9 100644 --- a/configs/milvus.yaml +++ b/configs/milvus.yaml @@ -78,7 +78,7 @@ dataNode: log: level: debug file: - rootPath: /tmp/milvus + rootPath: "" maxSize: 300 # MB maxAge: 10 # day maxBackups: 20 diff --git a/internal/datanode/param_table.go b/internal/datanode/param_table.go index 5a2c71a4a4..298fcdcd5a 100644 --- a/internal/datanode/param_table.go +++ b/internal/datanode/param_table.go @@ -311,5 +311,9 @@ func (p *ParamTable) initLogCfg() { if err != nil { panic(err) } - p.Log.File.Filename = path.Join(rootPath, "datanode-"+strconv.FormatInt(p.NodeID, 10)+".log") + if len(rootPath) != 0 { + p.Log.File.Filename = path.Join(rootPath, "datanode-"+strconv.FormatInt(p.NodeID, 10)+".log") + } else { + p.Log.File.Filename = "" + } } diff --git a/internal/dataservice/param.go b/internal/dataservice/param.go index 2d45113032..15f7c2d449 100644 --- a/internal/dataservice/param.go +++ b/internal/dataservice/param.go @@ -237,5 +237,9 @@ func (p *ParamTable) initLogCfg() { if err != nil { panic(err) } - p.Log.File.Filename = path.Join(rootPath, "dataservice-"+strconv.FormatInt(p.NodeID, 10)+".log") + if len(rootPath) != 0 { + p.Log.File.Filename = path.Join(rootPath, "dataservice-"+strconv.FormatInt(p.NodeID, 10)+".log") + } else { + p.Log.File.Filename = "" + } } diff --git a/internal/masterservice/param_table.go b/internal/masterservice/param_table.go index bc3ee0307f..93c20a95c6 100644 --- a/internal/masterservice/param_table.go +++ b/internal/masterservice/param_table.go @@ -203,5 +203,9 @@ func (p *ParamTable) initLogCfg() { if err != nil { panic(err) } - p.Log.File.Filename = path.Join(rootPath, fmt.Sprintf("masterservice-%d.log", p.NodeID)) + if len(rootPath) != 0 { + p.Log.File.Filename = path.Join(rootPath, fmt.Sprintf("masterservice-%d.log", p.NodeID)) + } else { + p.Log.File.Filename = "" + } } diff --git a/internal/querynode/param_table.go b/internal/querynode/param_table.go index 0deba81600..77c89dcc44 100644 --- a/internal/querynode/param_table.go +++ b/internal/querynode/param_table.go @@ -469,5 +469,9 @@ func (p *ParamTable) initLogCfg() { if err != nil { panic(err) } - p.Log.File.Filename = path.Join(rootPath, fmt.Sprintf("querynode-%d.log", p.QueryNodeID)) + if len(rootPath) != 0 { + p.Log.File.Filename = path.Join(rootPath, fmt.Sprintf("querynode-%d.log", p.QueryNodeID)) + } else { + p.Log.File.Filename = "" + } } diff --git a/internal/queryservice/param_table.go b/internal/queryservice/param_table.go index 9622926660..7b737db3d5 100644 --- a/internal/queryservice/param_table.go +++ b/internal/queryservice/param_table.go @@ -92,7 +92,11 @@ func (p *ParamTable) initLogCfg() { if err != nil { panic(err) } - p.Log.File.Filename = path.Join(rootPath, fmt.Sprintf("queryService-%d.log", p.NodeID)) + if len(rootPath) != 0 { + p.Log.File.Filename = path.Join(rootPath, fmt.Sprintf("queryService-%d.log", p.NodeID)) + } else { + p.Log.File.Filename = "" + } } func (p *ParamTable) initStatsChannelName() {