Abhilash Raj pushed to branch master at GNU Mailman / Mailman Core
Commits: 2fbc97f1 by Abhilash Raj at 2023-01-04T11:59:36+00:00 feat: Split http logger and gunicorn logger. Split http and gunicorn logger since they use different formats for logging format. Fixes #1049 - - - - - 0dec9aa9 by Abhilash Raj at 2023-01-04T11:59:36+00:00 Merge branch 'split-logger' into 'master' feat: Split http logger and gunicorn logger. Closes #1049 See merge request mailman/mailman!1090 - - - - - 5 changed files: - src/mailman/commands/docs/conf.rst - src/mailman/config/schema.cfg - src/mailman/docs/NEWS.rst - src/mailman/rest/gunicorn.py - src/mailman/rest/tests/test_systemconf.py Changes: ===================================== src/mailman/commands/docs/conf.rst ===================================== @@ -46,6 +46,7 @@ key, along with the names of the corresponding sections. [logging.debug] path: debug.log [logging.error] path: mailman.log [logging.fromusenet] path: mailman.log + [logging.gunicorn] path: mailman.log [logging.http] path: mailman.log [logging.locks] path: mailman.log [logging.mischief] path: mailman.log ===================================== src/mailman/config/schema.cfg ===================================== @@ -165,7 +165,7 @@ component_package: prompt: >>> # Banner to show on startup. -banner: Welcome to the GNU Mailman shell +banner: Welcome to the GNU Mailman shell Use commit() to commit changes. Use abort() to discard changes since the last commit. Exit with ctrl+D does an implicit commit() but exit() does not. @@ -369,6 +369,8 @@ level: info [logging.fromusenet] [logging.http] + +[logging.gunicorn] format: %(t)s "%(r)s" %(s)s %(b)s "%(f)s" "%(a)s" [logging.locks] ===================================== src/mailman/docs/NEWS.rst ===================================== @@ -11,7 +11,14 @@ Here is a history of user visible changes to Mailman. 3.3.9 ===== +Configuration +------------- +* **BREAKING CHANGE**: ``logging.http`` section has now been split into two + parts, ``logging.http`` is for the Mailman internal code and + ``logging.gunicorn`` is for Gunicorn specifically since they have + different logging formats. This should fix suprious errors with + ``KeyError: t`` that was often confusing for users. (Fixes #1049) .. _news-3.3.8: ===================================== src/mailman/rest/gunicorn.py ===================================== @@ -63,13 +63,13 @@ def make_gunicorn_server(): # some logging options since gunicorn sets up it's own loggers. host = config.webservice.hostname port = int(config.webservice.port) - log_path = os.path.join(config.LOG_DIR, config.logging.http['path']) + log_path = os.path.join(config.LOG_DIR, config.logging.gunicorn['path']) options = { 'bind': '{}:{}'.format(host, port), 'accesslog': log_path, 'errorlog': log_path, - 'loglevel': config.logging.http['level'], - 'access_log_format': config.logging.http['format'], + 'loglevel': config.logging.gunicorn['level'], + 'access_log_format': config.logging.gunicorn['format'], 'disable_redirect_access_to_syslog': True, 'workers': int(config.webservice.workers), 'post_worker_init': _post_worker_init, ===================================== src/mailman/rest/tests/test_systemconf.py ===================================== @@ -175,6 +175,7 @@ class TestSystemConfiguration(unittest.TestCase): 'logging.debug', 'logging.error', 'logging.fromusenet', + 'logging.gunicorn', 'logging.http', 'logging.locks', 'logging.mischief', View it on GitLab: https://gitlab.com/mailman/mailman/-/compare/2efd38f6e5028c09f729c9f6b352722cb3450ac4...0dec9aa906d6ca7993ba2be8d6aeb89174887dff -- View it on GitLab: https://gitlab.com/mailman/mailman/-/compare/2efd38f6e5028c09f729c9f6b352722cb3450ac4...0dec9aa906d6ca7993ba2be8d6aeb89174887dff You're receiving this email because of your account on gitlab.com.
_______________________________________________ Mailman-checkins mailing list -- mailman-checkins@python.org To unsubscribe send an email to mailman-checkins-le...@python.org https://mail.python.org/mailman3/lists/mailman-checkins.python.org/ Member address: arch...@jab.org