main
lizifeng 2023-03-20 11:47:46 +08:00
parent 811504c5d5
commit 1b026b8f2e
1 changed files with 3 additions and 1 deletions

View File

@ -106,7 +106,9 @@ func NewLogger(serverName string, config *Config) *ZapLog {
} }
func getRollingFileWriter(serverName string, config *Config) *lumberjack.Logger { func getRollingFileWriter(serverName string, config *Config) *lumberjack.Logger {
//filePath := config.LogFilePath if config.LogFilePath == "" {
config.LogFilePath = "logs"
}
return &lumberjack.Logger{ return &lumberjack.Logger{
Filename: filepath.Join(config.LogFilePath, serverName+".log"), Filename: filepath.Join(config.LogFilePath, serverName+".log"),