plone 4上的错误通知
我只想在plone 4中声明错误时收到电子邮件通知 对产品有什么想法或“操作方法”吗plone 4上的错误通知,plone,zope,Plone,Zope,我只想在plone 4中声明错误时收到电子邮件通知 对产品有什么想法或“操作方法”吗 感谢配置邮件记录器在中有文档记录,但我认为电子邮件日志通知已内置于最近的Zope2版本中,因此您现在应该在[instance]部分添加以下内容: event-log-custom = <email-notifier> from server@here.com to kdie@localhost subject "anything goes here" smtp-s
感谢配置邮件记录器在中有文档记录,但我认为电子邮件日志通知已内置于最近的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>
事件日志自定义=
从…起server@here.com
到kdie@localhost
主题“这里什么都有”
smtp服务器127.0.0.1
(示例自)您可以轻松地为Zope配置内置电子邮件通知,但我们发现添加该包使电子邮件更易于管理 该软件包增加了:
- 发送电子邮件的可定制动态主题行
- 发送的电子邮件带有可配置的标题,便于过滤
- 防洪保护,确保发送的电子邮件数量不会过多
- 支持需要身份验证的SMTP服务器
- 可配置日志条目筛选
plone.recipe.zope2instance
buildout配方支持即时邮件记录器;只需在[实例]
部分中定义一个mailinglogger
变量,并包括mailinglogger:
[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>
[实例]
配方=plone.recipe.zope2实例
蛋+=
邮件记录器
#这里还有其他选择
邮件记录器=
液位警告
洪水位100000
smtp服务器本地主机
从…起logger@example.com
出错-receiver@example.com
主题[ServerName错误][%(主机名)s]%(levelname)s-%(行)s
该软件包对我们在更大的集群上非常宝贵,在集群中,我们为每个实例配置额外的变量以包含在主题中;我们可以直接在主题中看到问题发生在哪个实例上。您需要在buildout.cfg中的自定义事件日志中添加电子邮件通知程序。不幸的是,无法将其附加到现有的日志记录配置中,但下面将模拟plone.recipe.zope2instance对事件日志所做的操作
event-log-custom =
<logfile>
path ${buildout:directory}/var/log/${:_buildout_section_name_}.log
level INFO
</logfile>
<email-notifier>
from server@here.com
to admin@company.com
subject "[Zope alert - ${:_buildout_section_name_}]"
smtp-server localhost
level error
</email-notifier>
事件日志自定义=
路径${buildout:directory}/var/log/${:\u buildout\u section\u name\u}.log
级别信息
从…起server@here.com
到admin@company.com
主题“[Zope alert-${:\u buildout\u section\u name}”
smtp服务器本地主机
水平误差
也很方便。我试过了,我的日志文件消失了-它们不再在var中/log@scarba05:查看此问题的另一个答案,其中日志文件被保留:显然,只需向字段添加更多内容。显然,上面的示例是错误的,级别被忽略(如果超出标记号,则可以为整个记录器和单个日志处理部分(如
)指定级别。我们现在在生产中使用我的示例中的确切语法,只是配置的值不同。