Mar*_*ers 11
您可以轻松地配置内置的电子邮件通知Zope的,但我们发现,加入mailinglogger封装使电子邮件更大量易于管理.
该套餐增加:
该plone.recipe.zope2instance扩建配方支持mailinglogger开箱即用; 只需mailinglogger在您的[instance]部分中定义一个变量并包含mailinglogger egg:
[instance]
recipe = plone.recipe.zope2instance
eggs +=
mailinglogger
# Other options go here
mailinglogger =
<mailing-logger>
level warning
flood-level 100000
smtp-server localhost
from logger@example.com
to error-receiver@example.com
subject [ServerName Error] [%(hostname)s] %(levelname)s - %(line)s
</mailing-logger>
Run Code Online (Sandbox Code Playgroud)
对于我们在较大的集群上,该软件包非常有价值,我们在每个实例中配置其他变量以包含在主题中; 我们可以直接在主题中看到问题发生的实例.
http://pypi.python.org/pypi/plone.recipe.zope2instance中记录了配置邮件记录器,但我认为电子邮件日志通知内置于最近的Zope2版本中,因此您现在应该向您添加以下[instance]内容:
event-log-custom =
<email-notifier>
from server@here.com
to kdie@localhost
subject "anything goes here"
smtp-server 127.0.0.1
</email-notifier>
Run Code Online (Sandbox Code Playgroud)
(例如来自http://myzope.kedai.com.my/blogs/kedai/44)