root(minor): disable uwsgi request loggin and use custom logging instead
This commit is contained in:
parent
d4cb1a98c7
commit
3353aa0298
|
@ -8,3 +8,4 @@ threads = 2
|
||||||
enable-threads = true
|
enable-threads = true
|
||||||
uid = passbook
|
uid = passbook
|
||||||
gid = passbook
|
gid = passbook
|
||||||
|
disable-logging=True
|
||||||
|
|
|
@ -14,14 +14,12 @@ from structlog import get_logger
|
||||||
|
|
||||||
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "passbook.root.settings")
|
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "passbook.root.settings")
|
||||||
|
|
||||||
LOGGER = get_logger()
|
|
||||||
|
|
||||||
|
|
||||||
class WSGILogger:
|
class WSGILogger:
|
||||||
""" This is the generalized WSGI middleware for any style request logging. """
|
""" This is the generalized WSGI middleware for any style request logging. """
|
||||||
|
|
||||||
def __init__(self, application):
|
def __init__(self, application):
|
||||||
self.application = application
|
self.application = application
|
||||||
|
self.logger = get_logger('passbook.wsgi')
|
||||||
|
|
||||||
def __healthcheck(self, start_response):
|
def __healthcheck(self, start_response):
|
||||||
start_response('204 OK', [])
|
start_response('204 OK', [])
|
||||||
|
@ -64,7 +62,7 @@ class WSGILogger:
|
||||||
query_string = ''
|
query_string = ''
|
||||||
if environ.get('QUERY_STRING') != '':
|
if environ.get('QUERY_STRING') != '':
|
||||||
query_string = f"?{environ.get('QUERY_STRING')}"
|
query_string = f"?{environ.get('QUERY_STRING')}"
|
||||||
LOGGER.info(f"{environ.get('PATH_INFO', '')}{query_string}",
|
self.logger.info(f"{environ.get('PATH_INFO', '')}{query_string}",
|
||||||
host=host,
|
host=host,
|
||||||
method=environ.get('REQUEST_METHOD', ''),
|
method=environ.get('REQUEST_METHOD', ''),
|
||||||
protocol=environ.get('SERVER_PROTOCOL', ''),
|
protocol=environ.get('SERVER_PROTOCOL', ''),
|
||||||
|
|
Reference in New Issue