Commit 22ec72df authored by Denis Laxalde's avatar Denis Laxalde
Browse files

[pyramid] Let logging be configured through .ini file

We do not initialize logging in CubicWebPyramidConfiguration thus
preventing logging to be started with cubicweb's configuration. On the
other hand, any logging configuration defined in ``development.ini``
file will be loaded by whatever start the instance using this file (i.e.
pserve, gunicorn, etc.). The benefit is that logging can now be
configured per "qualified name" in this file (i.e. one can easily set
the DEBUG level for the application cube while keeping all dependencies'
level to WARNING). In the development.ini template, we add logger
configurations for "logilab" and "cubicweb" qualified names (along with
those of the application cube).
parent 6a71cb23f827
......@@ -47,6 +47,11 @@ class CubicWebPyramidConfiguration(BaseWebConfiguration, ServerConfiguration):
options = merge_options(ServerConfiguration.options +
def init_log(self, *args, **kwargs):
"""Rely on logging configuration in Pyramid's .ini file, do nothing
def write_development_ini(self, cubes):
"""Write a 'development.ini' file into apphome."""
template_fpath = path.join(path.dirname(__file__), 'development.ini.tmpl')
......@@ -37,3 +37,47 @@ cubicweb.auth.authtkt.session.secret = %(auth-authtkt-session-secret)s
use = egg:waitress#main
listen = [::1]:6543
# logging configuration
keys = root, logilab, cubicweb, cubicweb_%(cubename)s
keys = console
keys = generic
level = INFO
handlers = console
level = WARNING
handlers = console
qualname = logilab
level = INFO
handlers = console
qualname = cubicweb
level = DEBUG
handlers = console
qualname = cubicweb_%(cubename)s
class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic
class = logilab.common.logging_ext.ColorFormatter
format = %%(asctime)s - (%%(name)s) %%(levelname)s: %%(message)s
datefmt = %%Y-%%m-%%d %%H:%%M:%%S
3.26 (unreleased)
New features
* For ``pyramid`` instance configuration kind, logging is not handled anymore
by CubicWeb but should be configured through ``development.ini`` file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment