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,15 +62,21 @@ class _trackSingleton
|
|||
$(document).bind( 'ajaxComplete', ( e, request, settings ) =>
|
||||
|
||||
# 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'
|
||||
responseText = ''
|
||||
if request.status >= 400
|
||||
level = 'error'
|
||||
responseText = request.responseText
|
||||
|
||||
if settings.data
|
||||
|
||||
# add length limitation
|
||||
if settings.data.length > 3000
|
||||
settings.data = settings.data.substr(0,3000)
|
||||
|
||||
# delete passwords form data
|
||||
if settings.data && typeof settings.data is 'string'
|
||||
if typeof settings.data is 'string'
|
||||
settings.data = settings.data.replace(/"password":".+?"/gi, '"password":"xxx"')
|
||||
|
||||
@log(
|
||||
|
|
Loading…
Reference in a new issue