[Plone 5.2/WSGI] maillogger alternative?

The maillogger is a ZServer related functionality that is no longer available with Plone 5.2 running under WSGI.
What would be a suitable replacement (apart from external services like Sentry)?

mailinglogger is a standalone library (https://pypi.org/project/mailinglogger/) providing handlers for the standard Python logging framework, and most WSGI servers either don't interfere with Python logging or provide a way to configure it. It shouldn't be too difficult to put the pieces together.

I use tha.logcheck for my Plone4, a bit out dated, but still usable.

There is a write-up at https://reinout.vanrees.org/weblog/2009/03/31/logchecker-zope-logfiles.html

No more in pypi, but can get it at

Here is a slightly modified wsgi.ini with mail integration.
Downside is that the wsgi.ini auto-generated by the zope2instance recipe from the hardcoded wsgi_ini_template inside recipe.py. Perhaps it would make sense to extend the recipe configuration with an optional template file that could be used instead of the default wsgi.ini template.

paste.server_factory = plone.recipe.zope2instance:main
use = egg:plone.recipe.zope2instance#main
fast-listen =
threads = 2

use = egg:Zope#main
zope_conf = /home/dgho-test/onkopedia_buildout/parts/instance1/etc/zope.conf

use = egg:Paste#translogger
setup_console_handler = False

pipeline =

keys = root, plone, waitress, wsgi

keys = console, accesslog, eventlog, mailer

keys = generic, message

level = INFO
handlers = console, eventlog, mailer

level = INFO
handlers = eventlog, mailer
qualname = plone

level = INFO
handlers = eventlog, mailer
qualname = waitress

level = INFO
handlers = accesslog
qualname = wsgi
propagate = 0

class = StreamHandler
args = (sys.stderr,)
level = NOTSET
formatter = generic

class = FileHandler
args = ('/home/dgho-test/onkopedia_buildout/var/log/instance1-access.log','a')
level = INFO
formatter = message

class = FileHandler
args = ('/home/dgho-test/onkopedia_buildout/var/log/instance1.log', 'a')
level = NOTSET
formatter = generic

class = handlers.SMTPHandler
args = ('localhost', 'onkopedia@onkopedia.com', ['info@zopyx.com'], 'Error Onkopedia')
level = ERROR
formatter = generic

format = %(asctime)s %(levelname)-7.7s [%(name)s:%(lineno)s][%(threadName)s] %(message)s

format = %(message)s

1 Like

+1. The included template is meant as a 80% case and is never going to cover every scenario.