Clean logging and sentry logging setup #4611
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes several changes to improve the logging level across various functions in the codebase. The primary change involves replacing
logger.exception
andlogger.error
withlogger.warning
to adjust the severity of the logged messages.Changes to logging levels:
src/hct_mis_api/apps/account/admin/ad.py
: Changed logging level fromlogger.exception
tologger.warning
in multiple functions to reduce the severity of log messages. [1] [2] [3]src/hct_mis_api/apps/account/admin/filters.py
: Updated logging fromlogger.exception
tologger.warning
in thequeryset
method.src/hct_mis_api/apps/account/admin/forms.py
: Adjusted logging level fromlogger.error
tologger.warning
in theclean_emails
method.src/hct_mis_api/apps/account/admin/mixins.py
: Modified logging level fromlogger.exception
tologger.warning
in several functions to better reflect the severity of the messages. [1] [2] [3] [4] [5] [6]src/hct_mis_api/apps/account/admin/user.py
: Changed logging fromlogger.exception
tologger.warning
in theimport_csv
method.src/hct_mis_api/apps/account/authentication.py
: Updated logging level fromlogger.error
tologger.warning
in therequire_email
method.src/hct_mis_api/apps/account/microsoft_graph.py
: Adjusted logging fromlogger.exception
andlogger.error
tologger.warning
in multiple functions. [1] [2]src/hct_mis_api/apps/account/models.py
: Changed logging level fromlogger.error
tologger.warning
in various validation methods. [1] [2] [3]src/hct_mis_api/apps/accountability/celery_tasks.py
: Modified logging fromlogger.exception
tologger.warning
in theexport_survey_sample_task
function.src/hct_mis_api/apps/accountability/services/message_crud_services.py
: Updated logging fromlogger.error
tologger.warning
in thecreate
method.src/hct_mis_api/apps/accountability/services/verifiers.py
: Adjusted logging fromlogger.error
tologger.warning
in theverify
method. [1] [2]src/hct_mis_api/apps/administration/panels/email.py
: Changed logging fromlogger.exception
tologger.warning
in theemail
method.src/hct_mis_api/apps/administration/panels/es.py
: Updated logging fromlogger.exception
tologger.warning
in the__call__
method.src/hct_mis_api/apps/core/admin.py
: Modified logging fromlogger.exception
tologger.warning
in multiple functions. [1] [2]src/hct_mis_api/apps/core/attributes_qet_queries.py
: Adjusted logging fromlogger.error
tologger.warning
in various query methods. [1] [2] [3]src/hct_mis_api/apps/core/celery_tasks.py
: Changed logging fromlogger.error
tologger.exception
in thewrapper_func
method to ensure full stack trace logging for exceptions.