From 775aa79262cace87c2443475c11abb9e5b609fe4 Mon Sep 17 00:00:00 2001 From: Liutauras Adomaitis Date: Fri, 16 Aug 2019 13:56:23 +0200 Subject: More logging in Wallace and --max-tasks per process option for wallaced Summary: Given that part of https://git.kolab.org/D761 changes are obsolete after commit baeee0049f06430801a2d9940f875747e51be7f5 I still want to have some changes find their way in master. Test Plan: None Reviewers: vanmeeuwen Subscribers: petersen, machniak, vanmeeuwen Differential Revision: https://git.kolab.org/D791 --- wallace/module_invitationpolicy.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'wallace/module_invitationpolicy.py') diff --git a/wallace/module_invitationpolicy.py b/wallace/module_invitationpolicy.py index d115c6c..46e506d 100644 --- a/wallace/module_invitationpolicy.py +++ b/wallace/module_invitationpolicy.py @@ -145,7 +145,10 @@ object_type_conditons = { 'task': COND_TYPE_TASK } -log = pykolab.getLogger('pykolab.wallace') +log = pykolab.getLogger('pykolab.wallace/invitationpolicy') +extra_log_params = {'qid': '-'} +log = pykolab.logger.LoggerAdapter(log, extra_log_params) + conf = pykolab.getConf() mybasepath = '/var/spool/pykolab/wallace/invitationpolicy/' @@ -184,10 +187,12 @@ def description(): return """Invitation policy execution module.""" def cleanup(): - global auth, imap, write_locks + global auth, imap, write_locks, extra_log_params log.debug("cleanup(): %r, %r" % (auth, imap), level=8) + extra_log_params['qid'] = '-' + auth.disconnect() del auth @@ -200,7 +205,11 @@ def cleanup(): remove_write_lock(key, False) def execute(*args, **kw): - global auth, imap + global auth, imap, extra_log_params + + filepath = args[0] + + extra_log_params['qid'] = os.path.basename(filepath) # (re)set language to default pykolab.translate.setUserLanguage(conf.get('kolab','default_locale')) @@ -217,8 +226,6 @@ def execute(*args, **kw): auth = Auth() imap = IMAP() - filepath = args[0] - # ignore calls on lock files if '/locks/' in filepath or kw.has_key('stage') and kw['stage'] == 'locks': return False -- cgit v1.1