From 1514ea003dfe39fa79a0ec07bbbc14f239cb4eb2 Mon Sep 17 00:00:00 2001 From: Marc Abramowitz Date: Mon, 7 Mar 2016 08:20:39 -0800 Subject: Pass vars to logging.config.fileConfig This allows one to set up a logging configuration that is parameterized based on variables specified on the command-line. e.g.: the application .ini file could have: ```ini [logger_root] level = %(LOGGING_LOGGER_ROOT_LEVEL)s handlers = console [handler_console] class = StreamHandler args = (sys.stderr,) level = %(LOGGING_HANDLER_CONSOLE_LEVEL)s formatter = generic ``` This app could be launched with: ``` pserve development.ini LOGGING_LOGGER_ROOT_LEVEL=DEBUG LOGGING_HANDLER_CONSOLE_LEVEL=DEBUG ``` --- CHANGES.txt | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'CHANGES.txt') diff --git a/CHANGES.txt b/CHANGES.txt index a17f4aab5..4a61dbffa 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -27,6 +27,12 @@ unreleased where you may need more control over the request. See https://github.com/Pylons/pyramid/pull/2393 +- Allow using variable substitutions like ``%(LOGGING_LOGGER_ROOT_LEVEL)s`` + for logging sections of the .ini file and populate these variables from + the ``pserve`` command line -- e.g.: + ``pserve development.ini LOGGING_LOGGER_ROOT_LEVEL=DEBUG`` + See https://github.com/Pylons/pyramid/pull/2399 + 1.6 (2015-04-14) ================ -- cgit v1.2.3