Skip to content

Standardize exception logging to use logger.exception() across codebase #1106

@coderabbitai

Description

@coderabbitai

Context

In PR #987, a code review suggested using logger.exception() instead of logger.error() for exception handling. This change was deferred because it should be applied consistently across the entire codebase rather than in a single PR.

Description

Currently, the codebase uses logger.error() in various places where exceptions are being logged. Django's logger.exception() is preferred because it automatically includes the full exception traceback, making debugging easier.

Proposed Change

  • Audit the codebase for instances where logger.error() is used within exception handlers
  • Replace with logger.exception() to automatically capture stack traces
  • Ensure consistency across all modules

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions