Added length limitation of data (just send first 3000 chars of log messages).
This commit is contained in:
parent
9c3a5d6bc5
commit
7ab79e4728
1 changed files with 10 additions and 4 deletions
|
@ -62,16 +62,22 @@ class _trackSingleton
|
||||||
$(document).bind( 'ajaxComplete', ( e, request, settings ) =>
|
$(document).bind( 'ajaxComplete', ( e, request, settings ) =>
|
||||||
|
|
||||||
# do not log ui requests
|
# do not log ui requests
|
||||||
if settings.url && settings.url.substr(settings.url-3,3) isnt '/ui'
|
if settings.url && settings.url.substr(settings.url.length-3,3) isnt '/ui'
|
||||||
level = 'notice'
|
level = 'notice'
|
||||||
responseText = ''
|
responseText = ''
|
||||||
if request.status >= 400
|
if request.status >= 400
|
||||||
level = 'error'
|
level = 'error'
|
||||||
responseText = request.responseText
|
responseText = request.responseText
|
||||||
|
|
||||||
# delete passwords form data
|
if settings.data
|
||||||
if settings.data && typeof settings.data is 'string'
|
|
||||||
settings.data = settings.data.replace(/"password":".+?"/gi, '"password":"xxx"')
|
# add length limitation
|
||||||
|
if settings.data.length > 3000
|
||||||
|
settings.data = settings.data.substr(0,3000)
|
||||||
|
|
||||||
|
# delete passwords form data
|
||||||
|
if typeof settings.data is 'string'
|
||||||
|
settings.data = settings.data.replace(/"password":".+?"/gi, '"password":"xxx"')
|
||||||
|
|
||||||
@log(
|
@log(
|
||||||
'ajax.send',
|
'ajax.send',
|
||||||
|
|
Loading…
Reference in a new issue