Tie the logging module to 'PythonOption IPADebug' in /etc/httpd/conf.d/ipa.conf

This commit is contained in:
Rob Crittenden 2007-12-11 09:56:37 -05:00
parent 40ff6f21db
commit 2675f35fdf
2 changed files with 10 additions and 10 deletions

View File

@ -53,11 +53,6 @@ DefaultUserContainer = "cn=users,cn=accounts"
DefaultGroupContainer = "cn=groups,cn=accounts" DefaultGroupContainer = "cn=groups,cn=accounts"
DefaultServiceContainer = "cn=services,cn=accounts" DefaultServiceContainer = "cn=services,cn=accounts"
# FIXME: need to check the ipadebug option in ipa.conf
#logging.basicConfig(level=logging.DEBUG,
# format='%(asctime)s %(levelname)s %(message)s',
# stream=sys.stderr)
# #
# Apache runs in multi-process mode so each process will have its own # Apache runs in multi-process mode so each process will have its own
# connection. This could theoretically drive the total number of connections # connection. This could theoretically drive the total number of connections
@ -807,6 +802,7 @@ class IPAServer:
"""Returns a list: counter followed by the results. """Returns a list: counter followed by the results.
If the results are truncated, counter will be set to -1.""" If the results are truncated, counter will be set to -1."""
logging.debug("IPA: find users %s" % criteria)
config = self.get_ipa_config(opts) config = self.get_ipa_config(opts)
if timelimit < 0: if timelimit < 0:
timelimit = float(config.get('ipasearchtimelimit')) timelimit = float(config.get('ipasearchtimelimit'))

View File

@ -32,6 +32,7 @@ import traceback
import pprint import pprint
from xmlrpclib import Marshaller,loads,dumps,Fault from xmlrpclib import Marshaller,loads,dumps,Fault
from mod_python import apache from mod_python import apache
import logging
import ipaserver import ipaserver
import funcs import funcs
@ -148,12 +149,15 @@ class ModXMLRPCRequestHandler(object):
opts['ipadebug'] = pythonopts.get("IPADebug") opts['ipadebug'] = pythonopts.get("IPADebug")
if opts['ipadebug'].lower() == "on": if opts['ipadebug'].lower() == "on":
logging.basicConfig(level=logging.DEBUG,
format='[%(asctime)s] [%(levelname)s] %(message)s',
datefmt='%a %b %d %H:%M:%S %Y',
stream=sys.stderr)
for o in opts: for o in opts:
sys.stderr.write("IPA: setting option %s: %s\n" % (o, opts[o])) logging.debug("IPA: setting option %s: %s" % (o, opts[o]))
sys.stderr.flush() # for e in req.subprocess_env:
for e in req.subprocess_env: # logging.debug("IPA: environment %s: %s" % (e, req.subprocess_env[e]))
sys.stderr.write("IPA: environment %s: %s\n" % (e, req.subprocess_env[e]))
sys.stderr.flush()
# Tack onto the end of the passed-in arguments any options we also # Tack onto the end of the passed-in arguments any options we also
# need # need