<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>4.3 apache - Access to Apache Internals.</title> <META NAME="description" CONTENT="4.3 apache - Access to Apache Internals."> <META NAME="keywords" CONTENT="modpython"> <META NAME="resource-type" CONTENT="document"> <META NAME="distribution" CONTENT="global"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link rel="STYLESHEET" href="modpython.css"> <LINK REL="next" href="pyapi-util.html"> <LINK REL="previous" href="pyapi-handler.html"> <LINK REL="up" href="pythonapi.html"> <LINK REL="next" href="pyapi-mptable.html"> </head> <body> <DIV CLASS="navigation"> <table align="center" width="100%" cellpadding="0" cellspacing="2"> <tr> <td><A href="pyapi-handler.html"><img src="icons/previous.gif" border="0" height="32" alt="Previous Page" width="32"></A></td> <td><A href="pythonapi.html"><img src="icons/up.gif" border="0" height="32" alt="Up One Level" width="32"></A></td> <td><A href="pyapi-mptable.html"><img src="icons/next.gif" border="0" height="32" alt="Next Page" width="32"></A></td> <td align="center" width="100%">Mod_python Manual</td> <td><A href="contents.html"><img src="icons/contents.gif" border="0" height="32" alt="Contents" width="32"></A></td> <td><img src="icons/blank.gif" border="0" height="32" alt="" width="32"></td> <td><A href="genindex.html"><img src="icons/index.gif" border="0" height="32" alt="Index" width="32"></A></td> </tr></table> <b class="navlabel">Previous:</b> <a class="sectref" href="pyapi-handler.html">4.2 Overview of a</A> <b class="navlabel">Up:</b> <a class="sectref" href="pythonapi.html">4. Python API</A> <b class="navlabel">Next:</b> <a class="sectref" href="pyapi-mptable.html">4.3.1 Table Object (mp_table) </A> <br><hr> </DIV> <!--End of Navigation Panel--> <H1><A NAME="SECTION006300000000000000000"> 4.3 <tt class="module">apache</tt> - Access to Apache Internals.</A> </H1> <P> The Python Application Programmer interface to Apache internals is contained in a module appropriately named <tt class="module">apache</tt>, located inside the <tt class="module">mod_python</tt> package. This module provides some important objects that map to Apache internal structures, as well as some useful functions, all documented below. <P> <a name='l2h-19'> </a>The <tt class="module">apache</tt> module can only be imported by a script running under mod_python. This is because it depends on a built-in module <tt class="module">_apache</tt> provided by mod_python. It is best imported like this: <P> <dl><dd><pre class="verbatim"> from mod_python import apache </pre></dl> <P> <tt class="module">mod_python.apache</tt> module defines the following objects and functions. For a more in-depth look at Apache internals, see the <em class='citetitle'><a href='http://dev.apache.org/API.html' title='Shambhala API Notes' >Shambhala API Notes</a></em> <P> <dl><dt><b><a name='l2h-17'><tt class='function'>log_error</tt></a></b>(<var>message</var><big>[</big><var>, level, server</var><big>]</big>) <dd> An interface to the Apache <em class='citetitle'><a href='http://dev.apache.org/apidoc/apidoc_ap_log_error.html' title='ap_log_error()' >ap_log_error()</a></em> function. <var>message</var> is a string with the error message, <var>level</var> is one of the following constants: <P> <dl><dd><pre class="verbatim"> APLOG_EMERG APLOG_ALERT APLOG_CRIT APLOG_ERR APLOG_WARNING APLOG_NOTICE APLOG_INFO APLOG_DEBUG APLOG_NOERRNO </pre></dl> <P> <var>server</var> is a reference to a <tt class="member">Request.server</tt> object. If <var>server</var> is not specified, then the error will be logged to the default error log, otherwise it will be written to the error log for the appropriate virtual server. </dl> <P> <dl><dt><b><a name='l2h-18'><tt class='function'>make_table</tt></a></b>() <dd> Returns a new empty object of type <code>mp_table</code>. See Section <A href="pyapi-mptable.html#pyapi-mptable">4.3.1</A> for a description of a table object. </dl> <P> <p><hr> <!--Table of Child-Links--> <A NAME="CHILD_LINKS"><STRONG>Subsections</STRONG></A> <UL CLASS="ChildLinks"> <LI><A NAME="tex2html475" href="pyapi-mptable.html">4.3.1 Table Object (mp_table)<a name='l2h-20'> </a></A> <LI><A NAME="tex2html476" href="pyapi-mprequest.html">4.3.2 Request Object<a name='l2h-22'> </a></A> <UL> <LI><A NAME="tex2html477" href="pyapi-mprequest-meth.html">4.3.2.1 Request Methods</A> <LI><A NAME="tex2html478" href="pyapi-mprequest-mem.html">4.3.2.2 Request Members</A> </UL> <LI><A NAME="tex2html479" href="pyapi-mpconn.html">4.3.3 Connection Object (mp_conn)<a name='l2h-79'> </a></A> <UL> <LI><A NAME="tex2html480" href="pyapi-mpconn-mem.html">4.3.3.1 Connection Members</A> </UL> <LI><A NAME="tex2html481" href="pyapi-mpserver.html">4.3.4 Server Object (mp_server)<a name='l2h-98'> </a></A> <UL> <LI><A NAME="tex2html482" href="pyapi-mpsrv-meth.html">4.3.4.1 Server Methods</A> <LI><A NAME="tex2html483" href="pyapi-mpsrv-mem.html">4.3.4.2 Server Members</A> </UL> <LI><A NAME="tex2html484" href="pyapi-debug.html">4.3.5 Debugging</A> <LI><A NAME="tex2html485" href="pyapi-callback.html">4.3.6 Internal Callback Object<a name='l2h-119'> </a></A> </UL> <!--End of Table of Child-Links--> <DIV CLASS="navigation"> <p><hr> <table align="center" width="100%" cellpadding="0" cellspacing="2"> <tr> <td><A href="pyapi-handler.html"><img src="icons/previous.gif" border="0" height="32" alt="Previous Page" width="32"></A></td> <td><A href="pythonapi.html"><img src="icons/up.gif" border="0" height="32" alt="Up One Level" width="32"></A></td> <td><A href="pyapi-mptable.html"><img src="icons/next.gif" border="0" height="32" alt="Next Page" width="32"></A></td> <td align="center" width="100%">Mod_python Manual</td> <td><A href="contents.html"><img src="icons/contents.gif" border="0" height="32" alt="Contents" width="32"></A></td> <td><img src="icons/blank.gif" border="0" height="32" alt="" width="32"></td> <td><A href="genindex.html"><img src="icons/index.gif" border="0" height="32" alt="Index" width="32"></A></td> </tr></table> <b class="navlabel">Previous:</b> <a class="sectref" href="pyapi-handler.html">4.2 Overview of a</A> <b class="navlabel">Up:</b> <a class="sectref" href="pythonapi.html">4. Python API</A> <b class="navlabel">Next:</b> <a class="sectref" href="pyapi-mptable.html">4.3.1 Table Object (mp_table) </A> <hr> <span class="release-info">Release 2.7.8, documentation updated on April 19, 2002.</span> </DIV> <!--End of Navigation Panel--> </BODY> </HTML>