Move successfull policy checks to trace

We use policy .. a lot ..

on an inactive system, we log at least 2-3 checks a
second (at INFO!).

We should log failures at info, and remain silent for the rest.

if we need to enable TRACE logging (for debugging) we can
add:

  'designate.policy=TRACE',

 to the log.set_defaults() call in designate/__init__.py

Change-Id: I2d059be9a5a127a687d0cb2cd02fa4915d1b6195
This commit is contained in:
Graham Hayes 2016-04-06 14:38:55 +01:00
parent 1a3b28610a
commit ac081195b2
1 changed files with 3 additions and 3 deletions

View File

@ -97,9 +97,9 @@ def check(rule, ctxt, target=None, do_raise=True, exc=exceptions.Forbidden):
extra = {'policy': {'rule': rule, 'target': target}}
if result:
LOG.info(_("Policy check succeeded for rule '%(rule)s' "
"on target %(target)s"),
{'rule': rule, 'target': repr(target)}, extra=extra)
LOG.trace(_("Policy check succeeded for rule '%(rule)s' "
"on target %(target)s"),
{'rule': rule, 'target': repr(target)}, extra=extra)
else:
LOG.info(_("Policy check failed for rule '%(rule)s' "
"on target %(target)s"),