Browse Source

日志收集

neo 1 year ago
parent
commit
93745434ef
3 changed files with 8 additions and 4 deletions
  1. 4 3
      common/utils/serverLogUtil.lua
  2. 3 1
      dev/utils/util_user.lua
  3. 1 0
      nodes/init_nodes.lua

+ 4 - 3
common/utils/serverLogUtil.lua

@@ -53,7 +53,7 @@ function root.logEvent(uid, version, channel, eventId, extraParams)
53
 end
53
 end
54
 
54
 
55
 -- 服务端资源埋点
55
 -- 服务端资源埋点
56
-function root.logResource(uid, eventId, itemId, resChgs, resResult, channel)
56
+function root.logResource(uid, eventId, itemId, resChgs, resResult, channel, bandShareCode)
57
     local now = timeUtil.currentTime()
57
     local now = timeUtil.currentTime()
58
     local date = timeUtil.toDate(now)
58
     local date = timeUtil.toDate(now)
59
     local dateStr = timeUtil.toString(now)
59
     local dateStr = timeUtil.toString(now)
@@ -61,11 +61,12 @@ function root.logResource(uid, eventId, itemId, resChgs, resResult, channel)
61
         date,
61
         date,
62
         dateStr,
62
         dateStr,
63
         uid,
63
         uid,
64
+        bandShareCode,
65
+        channel,
64
         eventId,
66
         eventId,
65
         itemId,
67
         itemId,
66
         resChgs or 0,
68
         resChgs or 0,
67
-        resResult or 0,
68
-        channel
69
+        resResult or 0
69
     }
70
     }
70
     local dataStr = root.formatData(data)
71
     local dataStr = root.formatData(data)
71
 
72
 

+ 3 - 1
dev/utils/util_user.lua

@@ -12,6 +12,7 @@ local nodeMgr = require("nodeMgr")
12
 local code = require("code")
12
 local code = require("code")
13
 
13
 
14
 local moduleData = require("data.module")
14
 local moduleData = require("data.module")
15
+local userData = require("data.user")
15
 
16
 
16
 local root = {}
17
 local root = {}
17
 
18
 
@@ -33,8 +34,9 @@ function root:log_resource(uid, keyEvent, itemId, delta, total)
33
     end
34
     end
34
 
35
 
35
     local channel = moduleData:get_channel(uid)
36
     local channel = moduleData:get_channel(uid)
37
+    local bandShareCode = userData:get_key_info(uid, "bandShareCode")
36
 
38
 
37
-    serverLogUtil.logResource(uid, keyEvent, itemId, delta, total, channel)
39
+    serverLogUtil.logResource(uid, keyEvent, itemId, delta, total, channel, bandShareCode)
38
 end
40
 end
39
 
41
 
40
 -- 通知
42
 -- 通知

+ 1 - 0
nodes/init_nodes.lua

@@ -41,6 +41,7 @@ end
41
 -- 日志
41
 -- 日志
42
 function root:init_logger()
42
 function root:init_logger()
43
     skynet.newservice("srvLoggerMgr")
43
     skynet.newservice("srvLoggerMgr")
44
+    skynet.uniqueservice("statisticLogSrv")
44
 end
45
 end
45
 
46
 
46
 -- 数据库
47
 -- 数据库