mirror of
https://github.com/zulip/zulip.git
synced 2025-11-09 16:37:23 +00:00
Fix (?) logging in runtornado.py
(imported from commit d5158005abebe496959989acaa69db269126e502)
This commit is contained in:
@@ -4,6 +4,7 @@ from django.conf import settings
|
|||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
import tornado.web
|
import tornado.web
|
||||||
|
import logging
|
||||||
|
|
||||||
class Command(BaseCommand):
|
class Command(BaseCommand):
|
||||||
option_list = BaseCommand.option_list + (
|
option_list = BaseCommand.option_list + (
|
||||||
@@ -69,10 +70,8 @@ class Command(BaseCommand):
|
|||||||
quit_command = 'CTRL-C'
|
quit_command = 'CTRL-C'
|
||||||
|
|
||||||
if settings.DEBUG:
|
if settings.DEBUG:
|
||||||
import logging
|
|
||||||
logging.basicConfig(level=logging.INFO,
|
logging.basicConfig(level=logging.INFO,
|
||||||
format='%(asctime)s %(levelname)-8s %(message)s')
|
format='%(asctime)s %(levelname)-8s %(message)s')
|
||||||
logger = logging.getLogger()
|
|
||||||
|
|
||||||
def inner_run():
|
def inner_run():
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
@@ -278,7 +277,7 @@ class AsyncDjangoHandler(tornado.web.RequestHandler, base.BaseHandler):
|
|||||||
finally:
|
finally:
|
||||||
receivers = signals.got_request_exception.send(sender=self.__class__, request=request)
|
receivers = signals.got_request_exception.send(sender=self.__class__, request=request)
|
||||||
except exceptions.PermissionDenied:
|
except exceptions.PermissionDenied:
|
||||||
logger.warning(
|
logging.warning(
|
||||||
'Forbidden (Permission denied): %s', request.path,
|
'Forbidden (Permission denied): %s', request.path,
|
||||||
extra={
|
extra={
|
||||||
'status_code': 403,
|
'status_code': 403,
|
||||||
|
|||||||
Reference in New Issue
Block a user