plon 4 上的错误通知

发布于 2024-11-06 21:03:17 字数 73 浏览 4 评论 0原文

我只想在 plone 4 中声明错误时收到电子邮件通知。

有任何产品想法或任何“操作方法”吗?

谢谢

I just want to have email notification when an error is declared in plone 4.

Any ideas of product or any "how-to" ?

Thanks

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

茶色山野 2024-11-13 21:03:17

您可以轻松地为 Zope 配置内置电子邮件通知,但我们发现添加 mailinglogger 包使电子邮件更易于管理。

该软件包添加了:

  • 已发送电子邮件的可定制和动态主题行
  • 发送的电子邮件带有可配置的标头,以便于过滤
  • 洪水防护,以确保发送的电子邮件数量不会过多
  • 支持需要身份验证的 SMTP 服务器
  • 可配置的日志条目过滤

plone.recipe .zope2instance 构建配方支持开箱即用的邮件记录器;只需在您的 [instance] 部分中定义一个 mailinglogger 变量并包含 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 [email protected]
    to [email protected]
    subject [ServerName Error] [%(hostname)s] %(levelname)s - %(line)s
  </mailing-logger>

该包对于我们在大型集群上的价值是无价的,我们在其中为每个实例配置额外的变量被纳入主题;我们可以直接在主题中看到问题发生在哪个实例上。

You can easily configure the built-in email notification for Zope, but we found that adding the mailinglogger package makes the emails a lot more managable.

The package adds:

  • customisable and dynamic subject lines for emails sent
  • emails sent with configurable headers for easy filtering
  • flood protection to ensure the number of emails sent is not excessive
  • support for SMTP servers that require authentication
  • configurable log entry filtering

The plone.recipe.zope2instance buildout recipe supports mailinglogger out of the box; simply define a mailinglogger variable in your [instance] part and include the 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 [email protected]
    to [email protected]
    subject [ServerName Error] [%(hostname)s] %(levelname)s - %(line)s
  </mailing-logger>

The package has been invaluable for us on larger clusters, where we configure additional variables per instance to be included in the subject; we can see what instance the problem occurred on directly in the subject.

那些过往 2024-11-13 21:03:17

配置邮件记录器记录在 http://pypi.python.org/pypi/plone。 Recipe.zope2instance 但我认为电子邮件日志通知内置于最近的 Zope2 版本中,因此您现在应该将以下内容添加到您的 [instance] 部分:(

event-log-custom =
  <email-notifier>
    from [email protected]
    to kdie@localhost
    subject "anything goes here"
    smtp-server 127.0.0.1
  </email-notifier>

示例来自 http://myzope.kedai.com.my/blogs/kedai/44)

Configuring mailing-logger is documented at http://pypi.python.org/pypi/plone.recipe.zope2instance but I think that email log notification is built into recent Zope2 releases, so you should now add the following to you [instance] section:

event-log-custom =
  <email-notifier>
    from [email protected]
    to kdie@localhost
    subject "anything goes here"
    smtp-server 127.0.0.1
  </email-notifier>

(example from http://myzope.kedai.com.my/blogs/kedai/44)

云巢 2024-11-13 21:03:17

您需要将电子邮件通知程序添加到 buildout.cfg 中的事件日志自定义中。不幸的是,无法将其附加到现有的日志记录配置中,但以下内容将模仿 plone.recipe.zope2instance 对事件日志所做的操作

event-log-custom =
  <logfile>
    path ${buildout:directory}/var/log/${:_buildout_section_name_}.log
    level INFO
  </logfile>
  <email-notifier>
    from [email protected]
    to [email protected]
    subject "[Zope alert - ${:_buildout_section_name_}]"
    smtp-server localhost
    level error
  </email-notifier>  

You need to add an email-notifier to your event-log-custom in buildout.cfg. Unfortunately there's no way to append it to your existing logging configuration but the following will mimic what plone.recipe.zope2instance does for the event log anyway

event-log-custom =
  <logfile>
    path ${buildout:directory}/var/log/${:_buildout_section_name_}.log
    level INFO
  </logfile>
  <email-notifier>
    from [email protected]
    to [email protected]
    subject "[Zope alert - ${:_buildout_section_name_}]"
    smtp-server localhost
    level error
  </email-notifier>  
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文