在Python Zope中,如何将error_log转储到浏览器?

发布于 2025-01-13 12:17:22 字数 235 浏览 5 评论 0原文

我们是一个大组织,我们使用 Python Zope。我们自然有两个版本:prod 和 dev。在生产中,我知道由于安全原因,我们不应该向最终用户显示错误日志,但我该如何为开发人员做到这一点?每次收到服务器内部错误时都手动检查错误日志非常麻烦。

我可以将错误日志直接转储到浏览器吗?

Zope v.4.6.2
Python v.3.8.0b2(默认,2019 年 7 月 9 日,16:47:40)[GCC 4.8.5]

We are a big org and we use Python Zope. We have naturally two versions: prod and dev. In production I understand due to security reasons we should not show error log to end users, but how do I do that for dev? It is very cumbersome to check the error log manually every time I get an internal server error.

Can I dump the error log directly onto the browser?

Zope v. 4.6.2
Python v. 3.8.0b2 (default, Jul 9 2019, 16:47:40) [GCC 4.8.5]

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

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

发布评论

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

评论(1

梦开始←不甜 2025-01-20 12:17:22

据我所知,Zope 使用 Products.SiteErrorLog 来记录错误。

Afair 在启动时,Zope 在启动时创建了一个 SiteErrorLog,您可以对其进行自定义。当时我对它进行了自定义,管理员帐户可以在浏览器中查看回溯,无论是登台环境还是生产环境。

在我的本地开发人员盒子上,我以前台模式启动 Zope,它直接将所有错误打印到我的终端,而不需要查看日志。

如果您无法配置错误日志,我建议您在 https://github 上创建问题。 com/zopefoundation/Products.SiteErrorLog 或在 https://community.plone.org/(标签:Zope)这是最活跃的 Plone/Zope 在线社区。

As far as I remember, Zope is using Products.SiteErrorLog for logging errors.

Afair on startup, Zope created a SiteErrorLog on startup, which you could customize. Back then I customized it in such a way that admin accounts could view the traceback in the browser, both for staging and production environments.

On my local developer box, I started Zope in foreground mode, which directly printed all errors to my terminal, without the need to look in logs.

If you cannot manage to configure the error log, I would suggest to create an issue at https://github.com/zopefoundation/Products.SiteErrorLog or ask your question again at https://community.plone.org/ (tag: Zope) which is the most active Plone/Zope community online.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文