improved logging for all responses

This commit is contained in:
Hossein Shafagh 2020-10-22 15:59:59 -07:00
parent 03d1af16e7
commit c2fe2b5e03
1 changed files with 6 additions and 0 deletions

View File

@ -20,7 +20,13 @@ def log_status_code(r, *args, **kwargs):
:param kwargs: :param kwargs:
:return: :return:
""" """
log_data = {
"reason": (r.reason if r.reason else ""),
"status_code": r.status_code,
"url": (r.url if r.url else ""),
}
metrics.send(f"entrust_status_code_{r.status_code}", "counter", 1) metrics.send(f"entrust_status_code_{r.status_code}", "counter", 1)
current_app.logger.info(log_data)
def determine_end_date(end_date): def determine_end_date(end_date):