Moved to new ui log format.
This commit is contained in:
parent
b3639e67b0
commit
12938c77a7
1 changed files with 12 additions and 10 deletions
|
@ -24,7 +24,8 @@ class _trackSingleton
|
||||||
@trackId = 'track-' + new Date().getTime() + '-' + Math.floor( Math.random() * 99999 )
|
@trackId = 'track-' + new Date().getTime() + '-' + Math.floor( Math.random() * 99999 )
|
||||||
@browser = App.Browser.detection()
|
@browser = App.Browser.detection()
|
||||||
@data = []
|
@data = []
|
||||||
@url = 'https://portal.znuny.com/api/ui'
|
# @url = 'https://log.znuny.com/api/ui'
|
||||||
|
@url = 'https://portal.znuny.com/api/v1/ui'
|
||||||
# @url = 'api/ui'
|
# @url = 'api/ui'
|
||||||
|
|
||||||
@log( 'start', 'notice', {} )
|
@log( 'start', 'notice', {} )
|
||||||
|
@ -89,14 +90,14 @@ class _trackSingleton
|
||||||
return
|
return
|
||||||
)
|
)
|
||||||
|
|
||||||
log: ( area, level, args ) ->
|
log: ( facility, level, args ) ->
|
||||||
return if !App.Config.get('ui_send_client_stats')
|
return if !App.Config.get('ui_send_client_stats')
|
||||||
info =
|
info =
|
||||||
time: Math.round( new Date().getTime() / 1000 )
|
time: Math.round( new Date().getTime() / 1000 )
|
||||||
area: area
|
facility: facility
|
||||||
level: level
|
level: level
|
||||||
location: window.location.href
|
location: window.location.pathname + window.location.hash
|
||||||
data: args
|
message: args
|
||||||
@data.push info
|
@data.push info
|
||||||
|
|
||||||
send: (async = true) =>
|
send: (async = true) =>
|
||||||
|
@ -110,9 +111,6 @@ class _trackSingleton
|
||||||
itemNew = _.clone( item )
|
itemNew = _.clone( item )
|
||||||
JSON.stringify(item)
|
JSON.stringify(item)
|
||||||
|
|
||||||
# add browser info
|
|
||||||
for item, value of @browser
|
|
||||||
itemNew[item] = value
|
|
||||||
newDataNew.push itemNew
|
newDataNew.push itemNew
|
||||||
catch e
|
catch e
|
||||||
# nothing
|
# nothing
|
||||||
|
@ -122,7 +120,11 @@ class _trackSingleton
|
||||||
url: @url
|
url: @url
|
||||||
async: async
|
async: async
|
||||||
data: JSON.stringify(
|
data: JSON.stringify(
|
||||||
|
meta:
|
||||||
track_id: @trackId
|
track_id: @trackId
|
||||||
|
host: window.location.host
|
||||||
|
protocol: window.location.protocol
|
||||||
|
browser: @browser
|
||||||
log: newDataNew
|
log: newDataNew
|
||||||
)
|
)
|
||||||
crossDomain: true
|
crossDomain: true
|
||||||
|
|
Loading…
Reference in a new issue