|
6 | 6 | import requests |
7 | 7 | from flask import Flask, request, make_response, jsonify |
8 | 8 | from flask_basicauth import BasicAuth |
9 | | -from helpers import get_token, get_all_workflow_runs |
| 9 | +from helpers import get_token, get_all_workflow_runs, redact_token |
10 | 10 | from config import BASIC_AUTH_USERNAME, BASIC_AUTH_PASSWORD, TIMEOUT |
11 | 11 |
|
12 | 12 | logging.basicConfig(level=logging.INFO) |
@@ -74,7 +74,7 @@ def index(): |
74 | 74 | response.headers['Content-Type'] = 'application/xml' |
75 | 75 |
|
76 | 76 | logger.info("Request URI: %s Response Code: %d", |
77 | | - request.path, response.status_code) |
| 77 | + redact_token(request.full_path), response.status_code) |
78 | 78 |
|
79 | 79 | return response |
80 | 80 |
|
@@ -154,6 +154,7 @@ def handle_error(exception): |
154 | 154 | Returns: |
155 | 155 | str: The error message response. |
156 | 156 | """ |
157 | | - logger.error("An error occurred: %s", str(exception)) |
| 157 | + logger.error("An error occurred: %s Request URI: %s", str(exception), |
| 158 | + redact_token(request.full_path)) |
158 | 159 | error_message = f"An error occurred: {str(exception)}" |
159 | 160 | return error_message, 500 |
0 commit comments