在Python Zope中,如何将error_log转储到浏览器?
我们是一个大组织,我们使用 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
据我所知,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.