changeset 6578:0d4dd9380a45

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.
author Thomas De Schampheleire <thomas.de.schampheleire@gmail.com>
date Mon, 20 Mar 2017 21:06:31 +0100
parents 69cd0c056aa1
children 72db2cd3e99e
files kallithea/config/middleware.py
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/kallithea/config/middleware.py	Sat Mar 18 21:37:27 2017 +0100
+++ b/kallithea/config/middleware.py	Mon Mar 20 21:06:31 2017 +0100
@@ -13,6 +13,7 @@
 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
 """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 @@
     ``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