diff --git a/icslog/icslog.go b/icslog/icslog.go index 16767b2..18791df 100644 --- a/icslog/icslog.go +++ b/icslog/icslog.go @@ -132,7 +132,7 @@ func NewIcsLog(conf *icsconf.LogConfig, level int, output int, path string, disk // log dir - /logs/voiceGW/tlo/{YYYYMMDD} yyyy, mm, dd := gIcsLog.CurrentDate.Date() hh, mi := time.Now().Hour(), time.Now().Minute() - gIcsLog.LogFileName = fmt.Sprintf("%s/LGT.%03d.%d%02d%02d%02d%02d.log", gIcsLog.Path, icsconf.GetIcsConfig().InfoConfig.ServerID, yyyy, mm, dd, hh, mi) + gIcsLog.LogFileName = fmt.Sprintf("%s/%d%02d%02d/LGT.%03d.%d%02d%02d%02d%02d.log", gIcsLog.Path, yyyy, mm, dd, icsconf.GetIcsConfig().InfoConfig.ServerID, yyyy, mm, dd, hh, mi) stat, err := os.Stat(gIcsLog.LogFileName) if err == nil { diff --git a/icssvc/icssvc.go b/icssvc/icssvc.go index b6eda36..b25c8d9 100644 --- a/icssvc/icssvc.go +++ b/icssvc/icssvc.go @@ -202,7 +202,7 @@ func (s IcsService) LogWatcher() *icserror.IcsError { // /logs/voiceGW/tlo/{YYYYMMDD}/LGT.001.202207140313.log // s.log.Path: /logs/voiceGW/tlo 로 변경 // 일자별 rotate를 날짜 폴더로 이동 - s.log.LogFileName = fmt.Sprintf("%s/LGT.%03d.%d%02d%02d%02d%02d.log", s.log.Path, s.config.InfoConfig.ServerID, y2, m2, d2, h2, mi2) + s.log.LogFileName = fmt.Sprintf("%s/%d%02d%02d/LGT.%03d.%d%02d%02d%02d%02d.log", s.log.Path, y2, m2, d2, s.config.InfoConfig.ServerID, y2, m2, d2, h2, mi2) var oerr error s.log.LogFile, oerr = os.OpenFile(s.log.LogFileName, os.O_RDWR|os.O_CREATE|os.O_APPEND, 0666) if oerr != nil {