Improve logging
- Report processing time in milliseconds. - Use module names in log messages instead of file-names without extensions.
This commit is contained in:
parent
9aa1c3732c
commit
540ca2adf3
3 changed files with 4 additions and 4 deletions
|
@ -51,7 +51,7 @@ args=('/dev/log', handlers.SysLogHandler.LOG_MAIL)
|
|||
# Default Postfix log format.
|
||||
#
|
||||
[formatter_postfixfmt]
|
||||
format=%(asctime)s %(module)s[%(process)d]: %(message)s
|
||||
format=%(asctime)s %(name)s[%(process)d]: %(message)s
|
||||
datefmt=%b %e %H:%M:%S
|
||||
style=%
|
||||
validate=True
|
||||
|
|
|
@ -49,8 +49,8 @@ class MailEncryptionProxy:
|
|||
LOG.exception("Got exception while processing", exc_info=te)
|
||||
return RESULT_ERROR
|
||||
|
||||
ellapsed = time.process_time() - start
|
||||
LOG.info(f'Message delivered in {ellapsed} ms')
|
||||
ellapsed = (time.process_time() - start) * 1000
|
||||
LOG.info(f'Message delivered in {ellapsed:.2f} ms')
|
||||
return RESULT_OK
|
||||
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ formatter=postfixfmt
|
|||
args=('test/logs/lacre.log', 'a+')
|
||||
|
||||
[formatter_postfixfmt]
|
||||
format=%(asctime)s %(module)s[%(process)d]: %(message)s
|
||||
format=%(asctime)s %(name)s[%(process)d]: %(message)s
|
||||
datefmt=%b %e %H:%M:%S
|
||||
style=%
|
||||
validate=True
|
||||
|
|
Loading…
Reference in a new issue