From 18e5e8778c81f4e903a6c2c93fe2a694355018b7 Mon Sep 17 00:00:00 2001 From: Jigme Datse Yli-Rasku Date: Wed, 29 May 2024 21:50:56 -0700 Subject: [PATCH] Changing fomatting handling (hopefully) This should change the format handling to hopefully give a better format. --- docs/courier-to-mailman3.md | 5 ++++- source/courier-to-mailman3.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/docs/courier-to-mailman3.md b/docs/courier-to-mailman3.md index 663eaba..52f883b 100644 --- a/docs/courier-to-mailman3.md +++ b/docs/courier-to-mailman3.md @@ -11,4 +11,7 @@ This is our current version trying to communicate between courier and mailman3. * Which I screwed up. I think I was typing in the wrong window. * It's not failing on command line. * Still failing, let's get some logging. - * Moved logging initialization, and included print statements \ No newline at end of file + * Moved logging initialization, and included print statements. + * OK, it's logging now (it may have been but not in the right location) + * It wasn't formatting correctly. +* Testing different way to handle formatting. \ No newline at end of file diff --git a/source/courier-to-mailman3.py b/source/courier-to-mailman3.py index 9e7cfdb..e87f3b7 100644 --- a/source/courier-to-mailman3.py +++ b/source/courier-to-mailman3.py @@ -17,7 +17,7 @@ logger = logging.getLogger(__name__) logging.basicConfig(filename='/opt/mailman/logs/courier-to-mailman.log', level=logging.INFO) FORMAT = '%(asctime)s %(clientip)-15s %(user)-8s %(message)s' -logging.basicConfig(format=FORMAT) +logger.Format(FORMAT) logger.info('Starting Logging (outside try)') print('Starting Logging (outside try)')