# HG changeset patch # User Thomas De Schampheleire # Date 2017-03-20 21:06:31 # Node ID 0d4dd9380a4513d3323ab647eb66e190528448b2 # Parent 69cd0c056aa18a1b533af8fe04892e67a22834ec config: activate logging on 'gearbox serve' With the switch from paster to gearbox, early logging did not show on the console anymore. This includes the initialization logging of TurboGears2. For our own gearbox commands, the activation of logging is done in kallithea/lib/paster_commands/common.py:_bootstrap_config, but for 'serve' this method is not used. 'gearbox serve' immediately runs the 'paste.app_factory' specified in setup.py, which is make_app. Extend make_app with logging initialization in the same way as is done in _bootstrap_config. diff --git a/kallithea/config/middleware.py b/kallithea/config/middleware.py --- a/kallithea/config/middleware.py +++ b/kallithea/config/middleware.py @@ -13,6 +13,7 @@ # along with this program. If not, see . """WSGI middleware initialization for the Kallithea application.""" +import logging from kallithea.config.app_cfg import base_config from kallithea.config.environment import load_environment @@ -41,5 +42,6 @@ def make_app(global_conf, full_stack=Tru ``app_conf`` contains all the application-specific settings (those defined under ``[app:main]``. """ + logging.config.fileConfig(global_conf['__file__']) app = make_base_app(global_conf, full_stack=full_stack, **app_conf) return app