From 5540e95249bcef0fdd975403e8034d0ef0fa5320 Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Tue, 23 Apr 2024 13:41:43 -0400 Subject: [PATCH] Only log if it's a 500 --- lib/galaxy/webapps/base/api.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/galaxy/webapps/base/api.py b/lib/galaxy/webapps/base/api.py index 22793c85550b..3da3ba3d3900 100644 --- a/lib/galaxy/webapps/base/api.py +++ b/lib/galaxy/webapps/base/api.py @@ -201,7 +201,8 @@ async def message_exception_middleware(request: Request, exc: MessageException) # Intentionally not logging traceback here as the full context will be # dispatched to Sentry if configured. This just makes logs less opaque # when one sees a 500. - log.info(f"MessageException: {exc}") + if exc.status_code >= 500: + log.info(f"MessageException: {exc}") return get_error_response_for_request(request, exc)