diff --git a/docs/courier-to-mailman3.md b/docs/courier-to-mailman3.md index 153c43a..3755635 100644 --- a/docs/courier-to-mailman3.md +++ b/docs/courier-to-mailman3.md @@ -17,4 +17,5 @@ This is our current version trying to communicate between courier and mailman3. * Testing different way to handle formatting. * Nope used `Format` not `Formater`. * This is not working -* Reverting to previous formatting \ No newline at end of file +* Reverting to previous formatting +* No idea what steps we've gone through to get here. \ No newline at end of file diff --git a/source/courier-to-mailman3.py b/source/courier-to-mailman3.py index df354a4..2008b26 100644 --- a/source/courier-to-mailman3.py +++ b/source/courier-to-mailman3.py @@ -17,7 +17,9 @@ 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) +formatter = logging.Formatter(FORMAT) +logger.setFormatter(formatter) + logger.info('format set to: %s', FORMAT) print('format set to: %s', FORMAT)