gin-server/lib/logging/file.go

25 lines
486 B
Go
Raw Normal View History

2019-11-02 12:54:10 +00:00
package logging
import (
"fmt"
"time"
"gin-server/lib/setting"
)
// getLogFilePath get the log file save path
func getLogFilePath() string {
return fmt.Sprintf("%s%s", setting.AppSetting.RuntimeRootPath, setting.AppSetting.LogSavePath)
}
// getLogFileName get the save name of the log file
func getLogFileName() string {
return fmt.Sprintf("%s%s.%s",
setting.AppSetting.LogSaveName,
time.Now().Format(setting.AppSetting.TimeFormat),
setting.AppSetting.LogFileExt,
)
}