This commit is contained in:
@@ -48,10 +48,16 @@ def filter(record: logging.LogRecord) -> bool:
|
|||||||
"GetUserDocuments",
|
"GetUserDocuments",
|
||||||
"GetDrafts",
|
"GetDrafts",
|
||||||
"During handling of the above exception",
|
"During handling of the above exception",
|
||||||
"await gather",
|
'File "/usr/local/lib/python3.13/site-packages/graphql/execution/execute.py"',
|
||||||
"raise error",
|
'File "/app/services/auth.py"',
|
||||||
"handle_field_error",
|
|
||||||
"await_result",
|
"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 # Не логируем ошибки авторизации и их трейсбеки
|
return False # Не логируем ошибки авторизации и их трейсбеки
|
||||||
@@ -199,10 +205,11 @@ ariadne_logger.addFilter(AriadneAuthFilter())
|
|||||||
graphql_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 = logging.getLogger(logger_name)
|
||||||
extra_logger.setLevel(logging.CRITICAL)
|
extra_logger.setLevel(logging.CRITICAL)
|
||||||
extra_logger.addFilter(AriadneAuthFilter())
|
extra_logger.addFilter(AriadneAuthFilter())
|
||||||
|
extra_logger.disabled = True # Полностью отключаем этот логгер
|
||||||
|
|
||||||
|
|
||||||
def custom_error_formatter(error: GraphQLError, debug: bool = False) -> dict[Any, Any]:
|
def custom_error_formatter(error: GraphQLError, debug: bool = False) -> dict[Any, Any]:
|
||||||
|
|||||||
Reference in New Issue
Block a user