# HG changeset patch # User Ludovic Chabant # Date 1590123341 25200 # Node ID d0f86d9a9d406a8fa75be5135e82033181895559 # Parent 3acfaf2e27f19198287af8a57ffb710d56966e3f wsgi: Better logging for the admin app. diff -r 3acfaf2e27f1 -r d0f86d9a9d40 piecrust/wsgiutil/__init__.py --- a/piecrust/wsgiutil/__init__.py Fri Oct 04 11:48:18 2019 -0700 +++ b/piecrust/wsgiutil/__init__.py Thu May 21 21:55:41 2020 -0700 @@ -4,10 +4,13 @@ def _setup_logging(log_file, log_level, max_log_bytes, log_backup_count): if log_file: + from logging import Formatter from logging.handlers import RotatingFileHandler handler = RotatingFileHandler(log_file, maxBytes=max_log_bytes, backupCount=log_backup_count) handler.setLevel(log_level) + handler.setFormatter(Formatter( + fmt='%(asctime)s %(levelname)s %(name)s: %(message)s')) logging.getLogger().addHandler(handler)