Logging Errors
The error log catches errors that may occur in a Plone site These are features such as Page Not Found (404) errors, unauthorized errors, and so on. This isn't designed to trap errors from forms. For instance, if somebody doesn't enter a required field in a form, then this won't be reported; this isn't an error since it's captured by the validation framework. This error log is designed to catch internal server errors that may occur.
From the Plone interface, click plone setup and then click Error Log
to see the errors reported by the Plone site. Click the exception in
the list (if there's one reported) to see the error
shows an error that occurred when incorrectly filling out the mail
settings form. It's a long page that includes a complete Python
traceback and the incoming request.
On the error log form you'll see the following settings:
- Number of exceptions to keep: These are the exceptions to keep in the active log on the screen. The default is 20.
- Copy exceptions to the event log: This copies each exception to the file-based log file. Not doing this means that no permanent record will be kept for exceptions. The default is that this is selected.
- Ignored exception types: This is a list (one per line) of exception types to ignore. The default is Unauthorized, NotFound, and Redirect.
You can log each exception and view it on the screen. This means if a user is visiting your site and an error occurs, then you can go to the error log and see what occurred. The three components of an error are the error type (which is the type of the error), the error value (which is a string explaining when an error occurs), and the traceback. These first two items are shown to a user on a standard error page.
So, when a user reports an error, the report will often include a message with the error name and a value in it. If user isn't allowed to do something and an Unauthorized error is raised or a Page Not Found (404) is triggered, then you'll get a custom error page rather than the standard page shown in Figure 4-6. The following standard error types occur:
- Unauthorized: This occurs when a user doesn't have the right to perform a function.
- NotFound: This occurs when the item a user is trying to access doesn't exist.
- Redirect: This is an error that can raise a Hypertext Transfer Protocol (HTTP) redirect.
- AttributeError: When an object doesn't have this attribute, this error is raised.
- ValueError: This occurs when a value given is incorrect and isn't caught correctly by the validation or other framework.

Experience Notes
Website Toolkit
Project websites
Workshops
IW Jobs
E-Bulletin