log full error url
This commit is contained in:
parent
c6ddf58cac
commit
c32503e1af
1 changed files with 5 additions and 4 deletions
|
@ -34,15 +34,16 @@ def logError(request, data):
|
||||||
if 'text' in data:
|
if 'text' in data:
|
||||||
if len(url) > 1000:
|
if len(url) > 1000:
|
||||||
url = url[:997] + '...'
|
url = url[:997] + '...'
|
||||||
text = data['text'] + '\n\n' + request.META.get('HTTP_USER_AGENT', '')[:4096]
|
text = data.get('url', '') + '\n\n' + \
|
||||||
l = models.Log(
|
data['text'] + '\n\n' + request.META.get('HTTP_USER_AGENT', '')[:4096]
|
||||||
|
log = models.Log(
|
||||||
text=text,
|
text=text,
|
||||||
line=int(data.get('line', 0)),
|
line=int(data.get('line', 0)),
|
||||||
url=url
|
url=url
|
||||||
)
|
)
|
||||||
if user:
|
if user:
|
||||||
l.user = user
|
log.user = user
|
||||||
l.save()
|
log.save()
|
||||||
response = json_response()
|
response = json_response()
|
||||||
return render_to_json_response(response)
|
return render_to_json_response(response)
|
||||||
actions.register(logError, cache=False)
|
actions.register(logError, cache=False)
|
||||||
|
|
Loading…
Reference in a new issue