diff --git a/utils/logger.py b/utils/logger.py index 6e049a96..70c9bafd 100644 --- a/utils/logger.py +++ b/utils/logger.py @@ -48,10 +48,16 @@ def filter(record: logging.LogRecord) -> bool: "GetUserDocuments", "GetDrafts", "During handling of the above exception", - "await gather", - "raise error", - "handle_field_error", + 'File "/usr/local/lib/python3.13/site-packages/graphql/execution/execute.py"', + 'File "/app/services/auth.py"', "await_result", + "handle_field_error", + "await gather", + "get_results", + "raise error", + "return_type, field_nodes, info, path, await result", + 'raise AuthorizationError("Требуется авторизация")', + "decorated_function", ] ): return False # Не логируем ошибки авторизации и их трейсбеки @@ -199,10 +205,11 @@ ariadne_logger.addFilter(AriadneAuthFilter()) graphql_logger.addFilter(AriadneAuthFilter()) # Дополнительно блокируем логи на уровне модулей -for logger_name in ["ariadne.log_error", "ariadne", "graphql.execution.execute"]: +for logger_name in ["ariadne.log_error", "ariadne", "graphql.execution.execute", "graphql.execution", "graphql.error"]: extra_logger = logging.getLogger(logger_name) extra_logger.setLevel(logging.CRITICAL) extra_logger.addFilter(AriadneAuthFilter()) + extra_logger.disabled = True # Полностью отключаем этот логгер def custom_error_formatter(error: GraphQLError, debug: bool = False) -> dict[Any, Any]: