[skip ci] capture caption and manifest syslog errors separately
This commit is contained in:
1 parent
8be85f2dd0
commit
d453730e3b
1 file changed
+27
-2
@@ -8,6 +8,13 @@ const FILENAME = "app_logs.txt"
|
|||||||
const FILENAME_PREVIOUS = "app_logs_previous.txt"
|
const FILENAME_PREVIOUS = "app_logs_previous.txt"
|
||||||
const FILENAME_STARTUP = "cachefs:/playlet_startup_logs.txt"
|
const FILENAME_STARTUP = "cachefs:/playlet_startup_logs.txt"
|
||||||
|
|
||||||
|
enum SysLogUrlType
|
||||||
|
Captions = "captions"
|
||||||
|
VideoPlayback = "videoplayback"
|
||||||
|
Manifest = "manifest"
|
||||||
|
Other = "other"
|
||||||
|
end enum
|
||||||
|
|
||||||
function Init()
|
function Init()
|
||||||
m.top.functionName = "LoggerLoop"
|
m.top.functionName = "LoggerLoop"
|
||||||
|
|
||||||
@@ -125,9 +132,10 @@ function OnLineSysLog(event as object, dateTime as object, logsFile as string, b
|
|||||||
buffer.FromAsciiString(line + `\n`)
|
buffer.FromAsciiString(line + `\n`)
|
||||||
buffer.AppendFile(logsFile)
|
buffer.AppendFile(logsFile)
|
||||||
|
|
||||||
fingerprint = `SysLog${info.Status}${info.LogType}${httpCode}${info.Method}`
|
urlType = GetSysLogUrlType(info.OrigUrl)
|
||||||
|
fingerprint = `SysLog-${urlType}-${info.Status}-${info.LogType}-${httpCode}-${info.Method}`
|
||||||
|
|
||||||
if ThrottleEvent("SysLogError", fingerprint, 60)
|
if ThrottleEvent("SysLogError" + urlType, fingerprint, 60)
|
||||||
return
|
return
|
||||||
end if
|
end if
|
||||||
|
|
||||||
@@ -138,6 +146,23 @@ function OnLineSysLog(event as object, dateTime as object, logsFile as string, b
|
|||||||
})
|
})
|
||||||
end function
|
end function
|
||||||
|
|
||||||
|
function GetSysLogUrlType(url as dynamic) as string
|
||||||
|
if not IsString(url)
|
||||||
|
return SysLogUrlType.Other
|
||||||
|
end if
|
||||||
|
|
||||||
|
if url.InStr("/api/timedtext") <> -1 or url.InStr("/api/v1/captions/") <> -1
|
||||||
|
return SysLogUrlType.Captions
|
||||||
|
end if
|
||||||
|
if url.InStr("/videoplayback") <> -1 or url.InStr("/api/dash/live-seg") <> -1
|
||||||
|
return SysLogUrlType.VideoPlayback
|
||||||
|
end if
|
||||||
|
if url.InStr("/api/manifest/") <> -1 or url.InStr("/api/dash") <> -1 or url.InStr("/api/hls") <> -1
|
||||||
|
return SysLogUrlType.Manifest
|
||||||
|
end if
|
||||||
|
return SysLogUrlType.Other
|
||||||
|
end function
|
||||||
|
|
||||||
function OnLineLogMonitorMemoryWarning(event as object, dateTime as object, logsFile as string, buffer as object) as void
|
function OnLineLogMonitorMemoryWarning(event as object, dateTime as object, logsFile as string, buffer as object) as void
|
||||||
info = event.getInfo()
|
info = event.getInfo()
|
||||||
message = "[WARN][AppMonitorMemory] " + ToString(info)
|
message = "[WARN][AppMonitorMemory] " + ToString(info)
|
||||||
|
|||||||
Reference in new issue
Block a user