From b1cb56d13f6520250c9823d1acb7af2904c79a07 Mon Sep 17 00:00:00 2001 From: Shay Nehmad Date: Sun, 21 Jul 2019 17:59:43 +0300 Subject: [PATCH] Added debug log when renewing TTLs for ease of debugging TTL issues --- monkey/monkey_island/cc/models/monkey.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/monkey/monkey_island/cc/models/monkey.py b/monkey/monkey_island/cc/models/monkey.py index 9a1559e3b..c049a63ee 100644 --- a/monkey/monkey_island/cc/models/monkey.py +++ b/monkey/monkey_island/cc/models/monkey.py @@ -2,6 +2,7 @@ Define a Document Schema for the Monkey document. """ import mongoengine +import logging from mongoengine import Document, StringField, ListField, BooleanField, EmbeddedDocumentField, ReferenceField, \ DateTimeField @@ -9,6 +10,8 @@ from monkey_island.cc.models.monkey_ttl import MonkeyTtl, create_monkey_ttl_docu from monkey_island.cc.consts import DEFAULT_MONKEY_TTL_EXPIRY_DURATION_IN_SECONDS +logger = logging.getLogger(__name__) + class Monkey(Document): """ This class has 2 main section: @@ -79,6 +82,7 @@ class Monkey(Document): return os def renew_ttl(self, duration=DEFAULT_MONKEY_TTL_EXPIRY_DURATION_IN_SECONDS): + logger.debug("Renewing TTL for monkey {0}".format(self.guid)) self.ttl_ref = create_monkey_ttl_document(duration)