#6955 (Remove existing logging handlers at startup?)

by Luc Saffre · in Developers · assigned to Luc Saffre

Kurzbeschreibung

I had already observed a few times that Lino doesn't log in certain situations. On the stewards site I had a concrete situation. It seems to happen when some early-life code emits a logger message before the settings have been fully imported. When this happens, the root looger has handlers and then Django decides to not install its own logging.

I fixed the problem on the stewards site by re-activating the following code in Site.setup_logging()

if len(logging.root.handlers) > 0:
for handler in logging.root.handlers[:]:
logging.root.removeHandler(handler)


Kinder

Kommentare