Added length limitation of data (just send first 3000 chars of log messages).

This commit is contained in:
Martin Edenhofer 2014-10-19 11:08:01 +02:00
parent 9c3a5d6bc5
commit 7ab79e4728

View file

@ -62,16 +62,22 @@ 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
# delete passwords form data
if settings.data && typeof settings.data is 'string'
settings.data = settings.data.replace(/"password":".+?"/gi, '"password":"xxx"')
if settings.data
# 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(
'ajax.send',