summaryrefslogtreecommitdiffstats
path: root/ipalib
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2011-02-11 17:24:20 -0500
committerRob Crittenden <rcritten@redhat.com>2011-02-14 10:23:52 -0500
commit29706fb13ba99b4309c2004668e952d997f25d5f (patch)
treeeb4326c59615b3839cac9fec53723f32d8d0f660 /ipalib
parent1315ba19d2c4bdda3dc50b46994f0c4ead5d7da0 (diff)
downloadfreeipa-29706fb13ba99b4309c2004668e952d997f25d5f.tar.gz
freeipa-29706fb13ba99b4309c2004668e952d997f25d5f.tar.xz
freeipa-29706fb13ba99b4309c2004668e952d997f25d5f.zip
Add default success/failure output logging.
Request logging on the server only happened if you added verbose=True or debug=True to the IPA config file. We should log the basics at least: who, what, result. Move a lot of entries from info to debug logging as well. Related to ticket 873
Diffstat (limited to 'ipalib')
-rw-r--r--ipalib/backend.py4
-rw-r--r--ipalib/frontend.py2
-rw-r--r--ipalib/plugable.py12
-rw-r--r--ipalib/plugins/user.py1
-rw-r--r--ipalib/plugins/virtual.py2
5 files changed, 12 insertions, 9 deletions
diff --git a/ipalib/backend.py b/ipalib/backend.py
index ad45238d8..2262e9227 100644
--- a/ipalib/backend.py
+++ b/ipalib/backend.py
@@ -62,7 +62,7 @@ class Connectible(Backend):
conn = self.create_connection(*args, **kw)
setattr(context, self.id, Connection(conn, self.disconnect))
assert self.conn is conn
- self.info('Created connection context.%s' % self.id)
+ self.debug('Created connection context.%s' % self.id)
def create_connection(self, *args, **kw):
raise NotImplementedError('%s.create_connection()' % self.id)
@@ -76,7 +76,7 @@ class Connectible(Backend):
)
self.destroy_connection()
delattr(context, self.id)
- self.info('Destroyed connection context.%s' % self.id)
+ self.debug('Destroyed connection context.%s' % self.id)
def destroy_connection(self):
raise NotImplementedError('%s.destroy_connection()' % self.id)
diff --git a/ipalib/frontend.py b/ipalib/frontend.py
index b9b75372c..45f5b74c6 100644
--- a/ipalib/frontend.py
+++ b/ipalib/frontend.py
@@ -412,7 +412,7 @@ class Command(HasParam):
params.update(self.get_default(**params))
params = self.normalize(**params)
params = self.convert(**params)
- self.info(
+ self.debug(
'%s(%s)', self.name, ', '.join(self._repr_iter(**params))
)
if not self.api.env.in_server and 'version' not in params:
diff --git a/ipalib/plugable.py b/ipalib/plugable.py
index a7e61ddbd..723414ced 100644
--- a/ipalib/plugable.py
+++ b/ipalib/plugable.py
@@ -409,10 +409,14 @@ class API(DictProxy):
stderr = logging.StreamHandler()
if self.env.debug:
stderr.setLevel(logging.DEBUG)
- elif self.env.verbose > 0:
- stderr.setLevel(logging.INFO)
else:
- stderr.setLevel(logging.WARNING)
+ if self.env.context == 'cli':
+ if self.env.verbose > 0:
+ stderr.setLevel(logging.INFO)
+ else:
+ stderr.setLevel(logging.WARNING)
+ else:
+ stderr.setLevel(logging.INFO)
stderr.setFormatter(util.LogFormatter(FORMAT_STDERR))
log.addHandler(stderr)
@@ -549,7 +553,7 @@ class API(DictProxy):
try:
__import__(fullname)
except errors.SkipPluginModule, e:
- self.log.info(
+ self.log.debug(
'skipping plugin module %s: %s', fullname, e.reason
)
except StandardError, e:
diff --git a/ipalib/plugins/user.py b/ipalib/plugins/user.py
index 12e17131f..2b0e88487 100644
--- a/ipalib/plugins/user.py
+++ b/ipalib/plugins/user.py
@@ -296,7 +296,6 @@ class user_del(LDAPDelete):
msg_summary = _('Deleted user "%(value)s"')
def post_callback(self, ldap, dn, *keys, **options):
- self.log.info('IPA: %s "%s"' % (self.name, keys[-1]))
return True
api.register(user_del)
diff --git a/ipalib/plugins/virtual.py b/ipalib/plugins/virtual.py
index 1d70793f1..c827d3d9d 100644
--- a/ipalib/plugins/virtual.py
+++ b/ipalib/plugins/virtual.py
@@ -53,7 +53,7 @@ class VirtualCommand(Command):
operation = self.operation
ldap = self.api.Backend.ldap2
- self.log.info("IPA: virtual verify %s" % operation)
+ self.log.debug("IPA: virtual verify %s" % operation)
operationdn = "cn=%s,%s,%s" % (operation, self.api.env.container_virtual, self.api.env.basedn)