diff --git a/basedosdados_api/logger.py b/basedosdados_api/logger.py index a12d6403..21b735f8 100644 --- a/basedosdados_api/logger.py +++ b/basedosdados_api/logger.py @@ -40,7 +40,7 @@ def setup_logger( logger.add( stdout, - level="INFO", + level="DEBUG", format=format, serialize=serialize, ) diff --git a/basedosdados_api/middlewares.py b/basedosdados_api/middlewares.py index 78d0cf2a..993ec9ab 100644 --- a/basedosdados_api/middlewares.py +++ b/basedosdados_api/middlewares.py @@ -20,10 +20,11 @@ def process_template_response(self, request: WSGIRequest, response: TemplateResp user = request.user endpoint = request.get_full_path() logger.warning( - f"VALIDATION_ERROR: {repr(errors)}", + f"{repr(errors)}", user=user, errors=errors, endpoint=endpoint, + type="validation", ) except Exception as e: logger.error(e)