bb-plane-fork/apiserver/plane/utils/exception_logger.py
Nikhil 833b82e247
[WEB-3927] chore: add logging to support json logging (#6955)
* chore: update logging to json based logging

* chore: add logging to file
2025-04-22 17:41:58 +05:30

18 lines
339 B
Python

# Python imports
import logging
import traceback
# Django imports
from django.conf import settings
def log_exception(e):
# Log the error
logger = logging.getLogger("plane.exception")
logger.exception(e)
if settings.DEBUG:
# Print the traceback if in debug mode
print(traceback.format_exc())
return