Direct singlenode log to file

Signed-off-by: zhenshan.cao <zhenshan.cao@zilliz.com>
This commit is contained in:
zhenshan.cao 2021-04-02 11:59:30 +08:00 committed by yefu.chen
parent ed32dfd1ae
commit 39ac47d16c

View File

@ -31,13 +31,13 @@ func initLogCfg() log.Config {
logCfg.File.MaxDays = 10
// FIXME(wxyu): Load from config files
logCfg.File.Filename = ""
//ciFileDir := "/milvus-distributed/logs/"
//if _, err := os.Stat(ciFileDir); err == nil {
// logCfg.File.Filename = ciFileDir + "singlenode.log"
//} else {
// logCfg.File.Filename = "/tmp/milvus/singlenode.log"
//}
//logCfg.File.Filename = ""
ciFileDir := "/milvus-distributed/logs/"
if _, err := os.Stat(ciFileDir); err == nil {
logCfg.File.Filename = ciFileDir + "singlenode.log"
} else {
logCfg.File.Filename = "/tmp/milvus/singlenode.log"
}
return logCfg
}