From e467cda72d7521f99c6322e14d9ba2b44a1752b9 Mon Sep 17 00:00:00 2001 From: Joseph Schorr Date: Tue, 13 Oct 2015 10:45:49 -0400 Subject: [PATCH] Add DEBUGLOG flag for enabling full debug logs in all gunicorn components Fixes #625 --- registry.py | 4 ++++ verbs.py | 3 +++ web.py | 6 ++++++ 3 files changed, 13 insertions(+) diff --git a/registry.py b/registry.py index 5d8dab3df..492fb633f 100644 --- a/registry.py +++ b/registry.py @@ -1,5 +1,6 @@ import logging import logging.config +import os from app import app as application @@ -9,5 +10,8 @@ import endpoints.decorated from endpoints.v1 import v1_bp # from endpoints.v2 import v2_bp +if os.environ.get('DEBUGLOG') == 'true': + logging.config.fileConfig('conf/logging_debug.conf', disable_existing_loggers=False) + application.register_blueprint(v1_bp, url_prefix='/v1') # application.register_blueprint(v2_bp, url_prefix='/v2') diff --git a/verbs.py b/verbs.py index fcde6ad47..8c0c7af16 100644 --- a/verbs.py +++ b/verbs.py @@ -1,3 +1,4 @@ +import os import logging import logging.config @@ -5,5 +6,7 @@ from app import app as application from endpoints.verbs import verbs +if os.environ.get('DEBUGLOG') == 'true': + logging.config.fileConfig('conf/logging_debug.conf', disable_existing_loggers=False) application.register_blueprint(verbs, url_prefix='/c1') diff --git a/web.py b/web.py index b71884583..96457d5c9 100644 --- a/web.py +++ b/web.py @@ -1,3 +1,6 @@ +import os +import logging.config + from app import app as application from endpoints.api import api_bp @@ -9,6 +12,9 @@ from endpoints.githubtrigger import githubtrigger from endpoints.gitlabtrigger import gitlabtrigger from endpoints.bitbuckettrigger import bitbuckettrigger +if os.environ.get('DEBUGLOG') == 'true': + logging.config.fileConfig('conf/logging_debug.conf', disable_existing_loggers=False) + application.register_blueprint(web) application.register_blueprint(githubtrigger, url_prefix='/oauth2') application.register_blueprint(gitlabtrigger, url_prefix='/oauth2')