diff --git a/swh/web/api/apiresponse.py b/swh/web/api/apiresponse.py --- a/swh/web/api/apiresponse.py +++ b/swh/web/api/apiresponse.py @@ -24,7 +24,7 @@ from swh.web.common.utils import gen_path_info, shorten_path from swh.web.config import get_config -logger = logging.Logger(__name__) +logger = logging.getLogger("django") def compute_link_header(rv: Dict[str, Any], options: Dict[str, Any]) -> Dict[str, Any]: @@ -204,7 +204,7 @@ if get_config()["debug"]: error_data["traceback"] = traceback.format_exc() - logger.error(error_data["traceback"]) + logger.debug(error_data["traceback"]) return make_api_response(request, error_data, doc_data, options=error_opts) diff --git a/swh/web/common/exc.py b/swh/web/common/exc.py --- a/swh/web/common/exc.py +++ b/swh/web/common/exc.py @@ -14,7 +14,7 @@ from swh.web.config import get_config -logger = logging.Logger(__name__) +logger = logging.getLogger("django") class BadInputExc(ValueError): @@ -138,7 +138,7 @@ error_description = "%s: %s" % (type(exc).__name__, str(exc)) if get_config()["debug"]: error_description = traceback.format_exc() - logger.error(error_description) + logger.debug(error_description) if isinstance(exc, BadInputExc): error_code = 400 if isinstance(exc, ForbiddenExc):