Merge pull request #4769 from stsewd/upgrade-logs-middleware

Upgrade logs from debug on middleware
humitos/integrations/handle-error-codes
Eric Holscher 2018-10-17 10:31:50 +02:00 committed by GitHub
commit 8f6776cb01
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -107,17 +107,17 @@ class SubdomainMiddleware(object):
slug = cname_to_slug(host)
cache.set(host, slug, 60 * 60)
# Cache the slug -> host mapping permanently.
log.debug(LOG_TEMPLATE.format(
log.info(LOG_TEMPLATE.format(
msg='CNAME cached: %s->%s' % (slug, host),
**log_kwargs))
request.slug = slug
request.urlconf = SUBDOMAIN_URLCONF
log.debug(LOG_TEMPLATE.format(
log.warning(LOG_TEMPLATE.format(
msg='CNAME detected: %s' % request.slug,
**log_kwargs))
except: # noqa
# Some crazy person is CNAMEing to us. 404.
log.debug(LOG_TEMPLATE.format(msg='CNAME 404', **log_kwargs))
log.warning(LOG_TEMPLATE.format(msg='CNAME 404', **log_kwargs))
raise Http404(_('Invalid hostname'))
# Google was finding crazy www.blah.readthedocs.org domains.
# Block these explicitly after trying CNAME logic.