1. 통합통계 로그 내용 수정

2. 로그 파일 경로, 이름 수정
main
JungJun 2 years ago
parent 7667175c9c
commit 17469b4e13

@ -128,10 +128,11 @@ func NewIcsLog(conf *icsconf.LogConfig, level int, output int, path string, disk
gIcsLog.DelDay = conf.DelConfig.DelDay
gIcsLog.DelHour = conf.DelConfig.DelHour
//make log file - icsvg.log-yyyymmdd
// make log file - LGT.001.20220715.log
// 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/icsvs.log-%d%02d%02d.%02d.%02d", gIcsLog.Path, yyyy, mm, dd, hh, mi)
gIcsLog.LogFileName = fmt.Sprintf("%s/LGT.%03d.%d%02d%02d%02d%02d.log", gIcsLog.Path, icsconf.GetIcsConfig().InfoConfig.ServerID, yyyy, mm, dd, hh, mi)
stat, err := os.Stat(gIcsLog.LogFileName)
if err == nil {

@ -187,35 +187,35 @@ func StatsCommandVG(t *icsnet.IcsTCPNet, bufend string) {
seqId := s.Seq + svc + randNum
insLog := ""
insLog += fmt.Sprintf("seqId:%s\n", seqId)
insLog += fmt.Sprintf("LogTime:%s, ", statInfos.LogTime)
insLog += fmt.Sprintf("LogType:%s, ", statInfos.LogType)
insLog += fmt.Sprintf("Sid:%s, ", statInfos.Sid)
insLog += fmt.Sprintf("ResultCode:%s, ", statInfos.ResultCode)
insLog += fmt.Sprintf("ReqTime:%s, ", statInfos.ReqTime)
insLog += fmt.Sprintf("RspTime:%s, ", statInfos.RspTime)
insLog += fmt.Sprintf("ClientIp:%s, ", statInfos.ClientIp)
insLog += fmt.Sprintf("DevInfo:%s, ", statInfos.DevInfo)
insLog += fmt.Sprintf("OsInfo:%s, ", statInfos.OsInfo)
insLog += fmt.Sprintf("NwInfo:%s, ", statInfos.NwInfo)
insLog += fmt.Sprintf("SvcName:%s, ", statInfos.SvcName)
insLog += fmt.Sprintf("DevModel:%s, ", statInfos.DevModel)
insLog += fmt.Sprintf("CarrierType:%s, ", statInfos.CarrierType)
insLog += fmt.Sprintf("HostName:%s, ", statInfos.HostName)
insLog += fmt.Sprintf("ScnName:%s, ", statInfos.ScnName)
insLog += fmt.Sprintf("CallId:%s, ", statInfos.CallId)
insLog += fmt.Sprintf("TrId:%s, ", statInfos.TrId)
insLog += fmt.Sprintf("ConcCall:%s, ", statInfos.ConcCall)
insLog += fmt.Sprintf("SvcType:%s, ", statInfos.SvcType)
insLog += fmt.Sprintf("SvcReqTime:%s, ", statInfos.SvcReqTime)
insLog += fmt.Sprintf("SvcRspTime:%s, ", statInfos.SvcRspTime)
insLog += fmt.Sprintf("TransferNo:%s, ", statInfos.TransferNo)
insLog += fmt.Sprintf("CallTime:%s, ", statInfos.CallTime)
insLog += fmt.Sprintf("CallType:%s, ", statInfos.CallType)
insLog += fmt.Sprintf("FunName:%s, ", statInfos.FunName)
insLog += fmt.Sprintf("ResultMsg:%s, ", statInfos.ResultMsg)
insLog += fmt.Sprintf("SttText:%s, ", statInfos.SttText)
insLog += fmt.Sprintf("TtsText:%s", statInfos.TtsText)
insLog += fmt.Sprintf("seqId=%s|", seqId)
insLog += fmt.Sprintf("LogTime=%s|", statInfos.LogTime)
insLog += fmt.Sprintf("LogType=%s|", statInfos.LogType)
insLog += fmt.Sprintf("Sid=%s|", statInfos.Sid)
insLog += fmt.Sprintf("ResultCode=%s|", statInfos.ResultCode)
insLog += fmt.Sprintf("ReqTime=%s|", statInfos.ReqTime)
insLog += fmt.Sprintf("RspTime=%s|", statInfos.RspTime)
insLog += fmt.Sprintf("ClientIp=%s|", statInfos.ClientIp)
insLog += fmt.Sprintf("DevInfo=%s|", statInfos.DevInfo)
insLog += fmt.Sprintf("OsInfo=%s|", statInfos.OsInfo)
insLog += fmt.Sprintf("NwInfo=%s|", statInfos.NwInfo)
insLog += fmt.Sprintf("SvcName=%s|", statInfos.SvcName)
insLog += fmt.Sprintf("DevModel=%s|", statInfos.DevModel)
insLog += fmt.Sprintf("CarrierType=%s|", statInfos.CarrierType)
insLog += fmt.Sprintf("HostName=%s|", statInfos.HostName)
insLog += fmt.Sprintf("ScnName=%s|", statInfos.ScnName)
insLog += fmt.Sprintf("CallId=%s|", statInfos.CallId)
insLog += fmt.Sprintf("TrId=%s|", statInfos.TrId)
insLog += fmt.Sprintf("ConcCall=%s|", statInfos.ConcCall)
insLog += fmt.Sprintf("SvcType=%s|", statInfos.SvcType)
insLog += fmt.Sprintf("SvcReqTime=%s|", statInfos.SvcReqTime)
insLog += fmt.Sprintf("SvcRspTime=%s|", statInfos.SvcRspTime)
insLog += fmt.Sprintf("TransferNo=%s|", statInfos.TransferNo)
insLog += fmt.Sprintf("CallTime=%s|", statInfos.CallTime)
insLog += fmt.Sprintf("CallType=%s|", statInfos.CallType)
insLog += fmt.Sprintf("FunName=%s|", statInfos.FunName)
insLog += fmt.Sprintf("ResultMsg=%s|", statInfos.ResultMsg)
insLog += fmt.Sprintf("SttText=%s|", statInfos.SttText)
insLog += fmt.Sprintf("TtsText=%s", statInfos.TtsText)
l.Printf(icslog.LOG_LEVEL_INFO, -1, "%s", insLog)
fmt.Printf("stats- %s \n", statInfos.SeqId)

@ -199,7 +199,10 @@ func (s IcsService) LogWatcher() *icserror.IcsError {
fmt.Println(m2)
fmt.Println(d2)
*/
s.log.LogFileName = fmt.Sprintf("%s/icsvs.log-%d%02d%02d.%02d.%02d", s.log.Path, y2, m2, d2, h2, mi2)
// /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)
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 {

Loading…
Cancel
Save