0

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]

João Pimentel Ferreira
  • 14,289
  • 10
  • 80
  • 109

1 Answers1

1

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.

Jürgen Gmach
  • 5,366
  • 3
  • 20
  • 37
  • do you remember how did you customize it for admin accounts to have the traceback on the browser? – João Pimentel Ferreira Mar 10 '22 at 15:15
  • 1
    I think it was something simple as using a `tal:condition="user/isAdmin"`, which clearly does not help you. A solution depends on your used user system and whether you have some convenience functions available as the `isAdmin`. I saw you already posted on both the links I gave you. I am positive you will get help there. – Jürgen Gmach Mar 10 '22 at 15:37
  • `tal:condition="python: user.has_role('Manager')`, or if you prefer to define it beforehand: `tal:define="isAdmin python: user.has_role('Manager')"` and `tal:condition="isAdmin"` – Georg Pfolz Oct 29 '22 at 07:46