ramkrishanbhatt / modwsgi

Automatically exported from code.google.com/p/modwsgi
0 stars 0 forks source link

Need to improve Python error message logging. #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
At present, details of any exceptions generated in Python code are output
to the Apache error log file by calling PyErr_Print() and the
PyErr_Flush(). This works because Apache links the underlying stderr stream
to the Apache log file. Doing this is suboptimal as any association with a
specific request is lost.

At minimum, need to capture exception details and traceback, format it
along with details of process ID, server and WSGI application SCRIPT_NAME
and send it directly to the Apache error log using ap_log_rerror(). This
will have the result of also capturing date and time of request plugs any
details of client making the request such as an IP address.

Also need to look at whether sending error messages from scripts to the
standard Apache error log is the best approach. In mod_cgi it is possible
to have a distinct error log file for scripts. It may be better to also
have this ability so that all WSGI application errors can be logged
separately if desired.

Original issue reported on code.google.com by Graham.Dumpleton@gmail.com on 11 Mar 2007 at 7:35

GoogleCodeExporter commented 8 years ago
The ScriptLog directive in mod_cgi doesn't do what I thought it does. It is used
specifically to log input and output from a CGI script for debugging purposes. 
This
sort of functionality isn't necessary with WSGI at this level as that can be
implemented as WSGI middleware.

Independent of that, still need to capture and log stuff to Apache error log 
properly.

Original comment by Graham.Dumpleton@gmail.com on 19 Mar 2007 at 10:03

GoogleCodeExporter commented 8 years ago
Reasonably happen with how logging is done now.

Original comment by Graham.Dumpleton@gmail.com on 1 Apr 2007 at 1:37