From ba1a07f2c386ec1db55933ea25b244aa230661e5 Mon Sep 17 00:00:00 2001 From: Steve Martinelli Date: Mon, 27 Jun 2016 22:59:34 -0400 Subject: [PATCH] Do not spam the log with uncritical stacktraces This change reduces the amount of stacktrace spam in the keystone logs due to authentication attempts with identifiers that point to non-existent objects (users, domains, projects). Closes-Bug #1595513 Co-Authored-By: Rudolf Vriend Change-Id: I4a8e572fe31ecda45de2e80425e22714fdd4403a --- keystone/auth/controllers.py | 4 ++-- keystone/auth/plugins/core.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/keystone/auth/controllers.py b/keystone/auth/controllers.py index ffe7f20675..034a06dfd3 100644 --- a/keystone/auth/controllers.py +++ b/keystone/auth/controllers.py @@ -189,7 +189,7 @@ class AuthInfo(object): else: domain_ref = self.resource_api.get_domain(domain_id) except exception.DomainNotFound as e: - LOG.exception(six.text_type(e)) + LOG.warning(six.text_type(e)) raise exception.Unauthorized(e) self._assert_domain_is_enabled(domain_ref) return domain_ref @@ -453,7 +453,7 @@ class Auth(controller.V3Controller): try: user_ref = self.identity_api.get_user(auth_context['user_id']) except exception.UserNotFound as e: - LOG.exception(six.text_type(e)) + LOG.warning(six.text_type(e)) raise exception.Unauthorized(e) default_project_id = user_ref.get('default_project_id') diff --git a/keystone/auth/plugins/core.py b/keystone/auth/plugins/core.py index 64ad58890a..c28b74cd22 100644 --- a/keystone/auth/plugins/core.py +++ b/keystone/auth/plugins/core.py @@ -147,7 +147,7 @@ class BaseUserInfo(object): else: domain_ref = self.resource_api.get_domain(domain_id) except exception.DomainNotFound as e: - LOG.exception(six.text_type(e)) + LOG.warning(six.text_type(e)) raise exception.Unauthorized(e) self._assert_domain_is_enabled(domain_ref) return domain_ref @@ -177,7 +177,7 @@ class BaseUserInfo(object): user_ref['domain_id']) self._assert_domain_is_enabled(domain_ref) except exception.UserNotFound as e: - LOG.exception(six.text_type(e)) + LOG.warning(six.text_type(e)) raise exception.Unauthorized(e) self._assert_user_is_enabled(user_ref) self.user_ref = user_ref