diff --git a/social/apps/django_app/middleware.py b/social/apps/django_app/middleware.py index 1d099508c..e9aaebab5 100644 --- a/social/apps/django_app/middleware.py +++ b/social/apps/django_app/middleware.py @@ -8,6 +8,7 @@ from django.utils.http import urlquote from social.exceptions import SocialAuthBaseException +from social.utils import social_logger class SocialAuthExceptionMiddleware(object): @@ -31,6 +32,8 @@ def process_exception(self, request, exception): backend_name = getattr(backend, 'name', 'unknown-backend') message = self.get_message(request, exception) + social_logger.error(message) + url = self.get_redirect_uri(request, exception) try: messages.error(request, message, diff --git a/social/utils.py b/social/utils.py index 266dc71d0..27982a91a 100644 --- a/social/utils.py +++ b/social/utils.py @@ -3,6 +3,7 @@ import unicodedata import collections import functools +import logging import six import requests @@ -15,6 +16,8 @@ SETTING_PREFIX = 'SOCIAL_AUTH' +social_logger = logging.Logger('social') + def import_module(name): __import__(name)