forked from 0x2620/pandora
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 len(url) > 1000:
|
||||
url = url[:997] + '...'
|
||||
text = data['text'] + '\n\n' + request.META.get('HTTP_USER_AGENT', '')[:4096]
|
||||
l = models.Log(
|
||||
text = data.get('url', '') + '\n\n' + \
|
||||
data['text'] + '\n\n' + request.META.get('HTTP_USER_AGENT', '')[:4096]
|
||||
log = models.Log(
|
||||
text=text,
|
||||
line=int(data.get('line', 0)),
|
||||
url=url
|
||||
)
|
||||
if user:
|
||||
l.user = user
|
||||
l.save()
|
||||
log.user = user
|
||||
log.save()
|
||||
response = json_response()
|
||||
return render_to_json_response(response)
|
||||
actions.register(logError, cache=False)
|
||||
|
|
Loading…
Reference in a new issue