From 3f104d143f100efbd34571c28eaf4ea032cf23ae Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Apr 26 2015 09:48:31 +0000 Subject: Try to provide more information on how the error occured --- diff --git a/pagure/mail_logging.py b/pagure/mail_logging.py index f640b57..e073a1a 100644 --- a/pagure/mail_logging.py +++ b/pagure/mail_logging.py @@ -30,6 +30,8 @@ import os import socket import traceback +import flask + psutil = None try: import psutil @@ -77,6 +79,23 @@ class ContextInjector(logging.Filter): # pragma: no cover record.proc_name = current_process.name record.command_line = " ".join(current_process.cmdline) record.callstack = self.format_callstack() + + record.url = '-' + record.args = '-' + record.form = '-' + try: + record.url = flask.request.url + except RuntimeError: + pass + try: + record.args = flask.request.args + except RuntimeError: + pass + try: + record.form = flask.request.form + except RuntimeError: + pass + return True @staticmethod @@ -127,6 +146,12 @@ Module: %(module)s Function: %(funcName)s Time: %(asctime)s + +URL: %(url)s +args: %(args)s +form: %(form)s + + Message: --------