ap_log_error()
function. message is a string with the error message,
level is one of the following flags constants:
APLOG_EMERG
APLOG_ALERT
APLOG_CRIT
APLOG_ERR
APLOG_WARNING
APLOG_NOTICE
APLOG_INFO
APLOG_DEBUG
APLOG_NOERRNO
server is a reference to a req.server object. If
server 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. When server is not specified,
the setting of LogLevel does not apply, the LogLevel is dictated by
an httpd compile-time default, usually warn.
If you have a reference to a request object available, consider using req.log_error instead, it will prepend request-specific information such as the source IP of the request to the log entry.
module_name is a string containing the module name (it can
contain dots, e.g. mypackage.mymodule); autoreload
indicates whether the module should be reloaded if it has changed since
last import; when log is true, a message will be written to
the logs when a module is reloaded; path allows restricting
modules to specific paths.
Example:
from mod_python import apache
mymodule = apache.import_module('mymodule', log=1)
HTTP_NOT_IMPLEMENTED error.
Arguments can be one or more of the following:
M_GET
M_PUT
M_POST
M_DELETE
M_CONNECT
M_OPTIONS
M_TRACE
M_PATCH
M_PROPFIND
M_PROPPATCH
M_MKCOL
M_COPY
M_MOVE
M_LOCK
M_UNLOCK
M_VERSION_CONTROL
M_CHECKOUT
M_UNCHECKOUT
M_CHECKIN
M_UPDATE
M_LABEL
M_REPORT
M_MKWORKSPACE
M_MKACTIVITY
M_BASELINE_CONTROL
M_MERGE
M_INVALID
AP_MPMQ_NOT_SUPPORTED = 0 # This value specifies whether
# an MPM is capable of
# threading or forking.
AP_MPMQ_STATIC = 1 # This value specifies whether
# an MPM is using a static # of
# threads or daemons.
AP_MPMQ_DYNAMIC = 2 # This value specifies whether
# an MPM is using a dynamic # of
# threads or daemons.
The code argument must be one of the following:
AP_MPMQ_MAX_DAEMON_USED = 1 # Max # of daemons used so far AP_MPMQ_IS_THREADED = 2 # MPM can do threading AP_MPMQ_IS_FORKED = 3 # MPM can do forking AP_MPMQ_HARD_LIMIT_DAEMONS = 4 # The compiled max # daemons AP_MPMQ_HARD_LIMIT_THREADS = 5 # The compiled max # threads AP_MPMQ_MAX_THREADS = 6 # # of threads/child by config AP_MPMQ_MIN_SPARE_DAEMONS = 7 # Min # of spare daemons AP_MPMQ_MIN_SPARE_THREADS = 8 # Min # of spare threads AP_MPMQ_MAX_SPARE_DAEMONS = 9 # Max # of spare daemons AP_MPMQ_MAX_SPARE_THREADS = 10 # Max # of spare threads AP_MPMQ_MAX_REQUESTS_DAEMON= 11 # Max # of requests per daemon AP_MPMQ_MAX_DAEMONS = 12 # Max # of daemons by config
Example:
if apache.mpm_query(apache.AP_MPMQ_IS_THREADED):
# do something
else:
# do something else