[mod_python] apache's log and hook api in mod_python?

Kevin Wang kwang at activegrid.com
Tue Mar 8 21:03:58 EST 2005

Hi Graham,

Wow, that information sounds good enough!  Sorry for that I haven't been 
able to check the doc thoroughly.  Thanks a lot for your prompt response.

For my second question, actually it is unrelated with the first one.  In 
Apache 2's C api, we can create a hook in a module, and all the other 
modules are able to call that hook at any time.  I am wondering if 
mod_python allows us to create our own hook (using python), and other 
modules (probably C implementations) can call that hook.


-- Kevin

Graham Dumpleton wrote:
> Not sure that everything you might want is available or not. Access is
> provided to:
>   log_error(message[, level])
>   An interface to the Apache ap_log_rerror  function. message is a
>   string with the error message,  level is one of the following flags constants:
>   If you need to write to log and do not have a reference to a request object,
>   use the apache.log_error function.
> This is in the request object and is documented in:
>   http://www.modpython.org/live/current/doc-html/pyapi-mprequest-meth.html
> There also is mod_python.apache.log_error() which does the same thing.
> There is something about log levels in the server object.
>   http://www.modpython.org/live/current/doc-html/pyapi-mpsrv-mem.html
> You can also supply a log handler.
>   http://www.modpython.org/live/current/doc-html/dir-handlers-plh.html
> I can't remember any other log related stuff at the moment.
> Am not sure what you mean by "In addition, is that possible for us to
> create a hook in mod_python so that  other modules can call it?". Can
> you elaborate?
> Graham
> Kevin Wang wrote ..
>>Hi All,
>>Does mod_python expose Apache's log api, for example, ap_log_error() and
>>ap_log_rerror(), to mod_python's applications?  If not, how can we access
>>Apache's log api, or should we use our own logging?
>>In addition, is that possible for us to create a hook in mod_python so
>>other modules can call it?
>>I am not quite sure if this is the right mailing list for these questions.
>>If not, should I send it to python-dev at httpd.apache.org?
>>-- Kevin
>>Mod_python mailing list
>>Mod_python at modpython.org

More information about the Mod_python mailing list