Enhance tracebacks in persistent logs
Author
Shane Hathaway, shane@hathawaymix.org
Status
IsImplemented (expect it in Zope 3.3)
Problem
When an exception occurs in Zope 3, valuable information about the exception is available through __traceback_info__ and __traceback_supplement__ variables on the stack. The information is especially useful for debugging page templates. While the online exception reporter uses a special traceback formatter to display the extra information online, the on-disk log currently does not include the extra information. Persisting the information would make debugging easier.
Goals
- Provide users the choice to use the special traceback formatter for on-disk logging.
- Use the special traceback formatter for logging by default.
- Format tracebacks with filenames rather than module names when logging to disk, since filenames provide more information.
Proposal
- Enhance the ZConfig logging component to allow a configuration file to specify a subclass of logging.Formatter.
- Create a subclass of logging.Formatter and put it in the zope.exceptions package, next to the special traceback formatter.
- Modify the default Zope configuration file to specify the new subclass of logging.Formatter.
- Enhance Zope's exception formatter to allow callers to select whether they want to display filenames or module names.
Risks
- This may increase the size of the logs. If that is a concern, users can switch to the standard traceback formatter.
Implementation status
Ready to check in, pending discussion and approval.
Sounds good to me. --srichter, 2006/01/18 18:38 EST reply
+1
