Changing fomatting handling (hopefully)

This should change the format handling to hopefully give a better
format.
This commit is contained in:
Jigme Datse Yli-Rasku 2024-05-29 21:50:56 -07:00
parent f3a169208b
commit 18e5e8778c
2 changed files with 5 additions and 2 deletions

View File

@ -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. * Which I screwed up. I think I was typing in the wrong window.
* It's not failing on command line. * It's not failing on command line.
* Still failing, let's get some logging. * Still failing, let's get some logging.
* Moved logging initialization, and included print statements * 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.

View File

@ -17,7 +17,7 @@ logger = logging.getLogger(__name__)
logging.basicConfig(filename='/opt/mailman/logs/courier-to-mailman.log', level=logging.INFO) logging.basicConfig(filename='/opt/mailman/logs/courier-to-mailman.log', level=logging.INFO)
FORMAT = '%(asctime)s %(clientip)-15s %(user)-8s %(message)s' FORMAT = '%(asctime)s %(clientip)-15s %(user)-8s %(message)s'
logging.basicConfig(format=FORMAT) logger.Format(FORMAT)
logger.info('Starting Logging (outside try)') logger.info('Starting Logging (outside try)')
print('Starting Logging (outside try)') print('Starting Logging (outside try)')