You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We're using django-redis as a session cache backend for our Django project, with DJANGO_REDIS_IGNORE_EXCEPTIONS and DJANGO_REDIS_LOG_IGNORED_EXCEPTIONS set to True.
Unfortunately, we're experiencing a pesky Redis TimeoutError, which due to the previous settings, is only getting logged as:
The issue happens only in the production environment, and we can't get a full exception traceback without impacting customers, so debugging this has been difficult. We'll probably work around this by live-editing the cache module on the web servers.
What are your thoughts on using self.logger.exception instead of self.logger.error in the omit_exception decorator, or adding another setting (e.g. DJANGO_REDIS_LOG_EXCEPTION_TRACEBACK) which would control the logging behavior?
The text was updated successfully, but these errors were encountered:
Hello @tmarice,
yes that's perfectly fine by me,
I prefer using log.exception instead of log.error but since I inherited this project I did not touched that.
You are welcome to open a PR.
If I may give you an advice to use a tracing system, like Sentry and you would never have this problem again :)
Excellent, I'll try to free up some time in the following weeks to work on this.
Unfortunately, Sentry doesn't help here since the exception is caught and logged. Sentry picks it up from the logger, but it's missing local variables and the full traceback.
We're using django-redis as a session cache backend for our Django project, with DJANGO_REDIS_IGNORE_EXCEPTIONS and DJANGO_REDIS_LOG_IGNORED_EXCEPTIONS set to True.
Unfortunately, we're experiencing a pesky Redis TimeoutError, which due to the previous settings, is only getting logged as:
The issue happens only in the production environment, and we can't get a full exception traceback without impacting customers, so debugging this has been difficult. We'll probably work around this by live-editing the cache module on the web servers.
What are your thoughts on using
self.logger.exception
instead ofself.logger.error
in the omit_exception decorator, or adding another setting (e.g.DJANGO_REDIS_LOG_EXCEPTION_TRACEBACK
) which would control the logging behavior?The text was updated successfully, but these errors were encountered: