Re: [Zope3-Users] Re: Getting zope.publisher to log errors
On Tue, Jul 01, 2008 at 10:52:25AM -0700, Stephan Richter wrote: On Tuesday 01 July 2008, Philipp von Weitershausen wrote: It also has some code to log to a logger, I think. Except that by default logging to zlog is turned off. :-( We just created out own global and root error reporting utility to turn this on by default. (BTW, I think this should be the package default too.) +lots Being of the lazy type, I monkey patch the global utility in all my startup scripts. Would be great to get rid of those. Something like this: #XXX evil patch to get errors: from zope.app.error.error import globalErrorReportingUtility globalErrorReportingUtility.setProperties(1, copy_to_zlog=1, ignored_exceptions=('NotFound', 'Unauthorized')) Regards, Stephan -- Stephan Richter Web Software Design, Development and Training Google me. Zope Stephan Richter ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users -- Brian Sutherland ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
[Zope3-Users] Re: Getting zope.publisher to log errors
andrew wrote: Is it possible to modify the default behaviour of zope.publisher somehow when handling exceptions ? For instance, I want to log all the details of the exception when one occurs instead of the very unhelpful little default message returned by the http.py:handleException. I'm not sure the request's handleException method is even used directly the publisher. What I do know is that zope.publisher.publish.publish() calls the publication's handleException method. The publication is the actual app server, it defines how to do traversal, how to do security, and how to handle exceptions. The default publication looks up an error reporting utility which remembers exceptions so you can look at them through-the-web. It also has some code to log to a logger, I think. Anyway, the way to go is either to provide a custom error reporting utility (locally, that is) or to implement a custom publication with a custom handleException method. ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users
Re: [Zope3-Users] Re: Getting zope.publisher to log errors
On Tuesday 01 July 2008, Philipp von Weitershausen wrote: It also has some code to log to a logger, I think. Except that by default logging to zlog is turned off. :-( We just created out own global and root error reporting utility to turn this on by default. (BTW, I think this should be the package default too.) Regards, Stephan -- Stephan Richter Web Software Design, Development and Training Google me. Zope Stephan Richter ___ Zope3-users mailing list Zope3-users@zope.org http://mail.zope.org/mailman/listinfo/zope3-users