Trying formatting more...
I really want to get formatting to work.
This commit is contained in:
parent
b6182b204a
commit
7baad18daf
|
@ -18,3 +18,4 @@ This is our current version trying to communicate between courier and mailman3.
|
||||||
* Nope used `Format` not `Formater`.
|
* Nope used `Format` not `Formater`.
|
||||||
* This is not working
|
* This is not working
|
||||||
* Reverting to previous formatting
|
* Reverting to previous formatting
|
||||||
|
* No idea what steps we've gone through to get here.
|
|
@ -17,7 +17,9 @@ 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)
|
formatter = logging.Formatter(FORMAT)
|
||||||
|
logger.setFormatter(formatter)
|
||||||
|
|
||||||
|
|
||||||
logger.info('format set to: %s', FORMAT)
|
logger.info('format set to: %s', FORMAT)
|
||||||
print('format set to: %s', FORMAT)
|
print('format set to: %s', FORMAT)
|
||||||
|
|
Loading…
Reference in New Issue