def wrap(fun):
        @wraps(fun, assigned=available_attrs(fun))
        def inner(task_id, sender, **kwargs):
            logger.info('Primary task %s issued a secondary mgmt monitoring task %s', sender, task_id)
            status = None
            # Every monitoring task should collect logs
            # NOTE: However, the monitoring task is responsible for setting up the object related to the log entry
            kwargs['log'] = log = DetailLog(sender, msg)

            try:
                status = fun(task_id, sender, **kwargs)
            except Exception as exc:
                status = False
                log.add(CRITICAL, exc)
                raise exc
            finally:
                log.save(status)

            return status
        return inner