From 0a6c5e9fb554370ce81b4492e35b83db698bc814 Mon Sep 17 00:00:00 2001 From: Para Dox Date: Sun, 27 Apr 2025 23:18:07 +0700 Subject: [PATCH] simple look --- logging-proxy/proxy.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/logging-proxy/proxy.py b/logging-proxy/proxy.py index 3a79297a..93893c10 100644 --- a/logging-proxy/proxy.py +++ b/logging-proxy/proxy.py @@ -68,7 +68,7 @@ def proxy(): request_log = f"==> Request:\n{json.dumps(log_incoming, indent=2)}" # Send the original 'incoming' data to the target - response = requests.post(TARGET_URL_HTTP, json=incoming) + response = requests.post(TARGET_URL_HTTP, json=incoming) outgoing = response.json() log_lines = [request_log] @@ -79,6 +79,13 @@ def proxy(): # Track the method name if an error occurred and method exists in request if isinstance(incoming, dict) and 'method' in incoming: error_methods.add(incoming['method']) + else: + # Log only the method name for successful responses + method_name = "unknown_method" # Default if not found + if isinstance(incoming, dict) and 'method' in incoming: + method_name = incoming['method'] + response_log = f"<== Response (Success): Method '{method_name}' completed." + log_lines.append(response_log) print('\n---\n'.join(log_lines), file=sys.stdout, flush=True)