Trying formatting more...

I really want to get formatting to work.
This commit is contained in:
Jigme Datse Yli-Rasku 2024-05-29 22:18:19 -07:00
parent b6182b204a
commit 7baad18daf
2 changed files with 5 additions and 2 deletions

View File

@ -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
* Reverting to previous formatting
* No idea what steps we've gone through to get here.

View File

@ -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)