diff --git a/opensvc/core/node/nodedict.py b/opensvc/core/node/nodedict.py index 6e78ebf4f..0e3039162 100644 --- a/opensvc/core/node/nodedict.py +++ b/opensvc/core/node/nodedict.py @@ -420,7 +420,14 @@ "keyword": "dblog", "convert": "boolean", "default": True, - "text": "If true and dbopensvc is set, the objects action logs are reported to the collector. Set to false to disable log reporting to the collector, event if dbopensvc is set." + "text": "If true and dbopensvc is set, the objects action logs are reported to the collector. Set to false to disable log reporting to the collector, even if dbopensvc is set." + }, + { + "section": "node", + "keyword": "dblogcron", + "convert": "boolean", + "default": True, + "text": "If true and dbopensvc is set, the objects croned action logs are reported to the collector. Set to false to disable croned actions log reporting to the collector." }, { "section": "node", diff --git a/opensvc/core/objects/svc.py b/opensvc/core/objects/svc.py index b521558aa..c8843088a 100644 --- a/opensvc/core/objects/svc.py +++ b/opensvc/core/objects/svc.py @@ -1010,8 +1010,15 @@ def _action(self, action, options=None): action.startswith("json_"): return self.do_print_action(action, options) - if self.published_action(action, options): + def is_logged_action(): + if self.options.cron and not self.node.oget("node", "dblogcron"): + return False if self.node.oget("node", "dblog") and self.node.collector_env.dbopensvc and self.node.collector_env.uuid: + return True + return False + + if self.published_action(action, options): + if is_logged_action(): err = self.do_logged_action(action, options) else: self.log_action_header(action, options)