From 1b026b8f2e125ed2dba456e717493e4f490dbaed Mon Sep 17 00:00:00 2001 From: lizifeng Date: Mon, 20 Mar 2023 11:47:46 +0800 Subject: [PATCH] update --- mylog/log.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mylog/log.go b/mylog/log.go index 903a0b8..16e4db1 100644 --- a/mylog/log.go +++ b/mylog/log.go @@ -106,7 +106,9 @@ func NewLogger(serverName string, config *Config) *ZapLog { } func getRollingFileWriter(serverName string, config *Config) *lumberjack.Logger { - //filePath := config.LogFilePath + if config.LogFilePath == "" { + config.LogFilePath = "logs" + } return &lumberjack.Logger{ Filename: filepath.Join(config.LogFilePath, serverName+".log"),