From a06c6a622ee720ede430459376499daee27adbe2 Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Mon, 12 Sep 2022 18:57:39 +0530 Subject: [PATCH] Agent: Add log statements in class `push_all_events_to_island`'s `__call__()` --- monkey/infection_monkey/push_events_to_island.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/monkey/infection_monkey/push_events_to_island.py b/monkey/infection_monkey/push_events_to_island.py index 6eae55ae7..8aebacac2 100644 --- a/monkey/infection_monkey/push_events_to_island.py +++ b/monkey/infection_monkey/push_events_to_island.py @@ -16,9 +16,13 @@ class push_all_events_to_island: self._server_address = server_address def __call__(self, event: AbstractAgentEvent, topic=pub.AUTO_TOPIC): + topic_name = topic.getName() + + logger.debug(f"Pushing event of type {topic_name} to the Island at {self._server_address}") + requests.post( # noqa: DUO123 "https://%s/api/events" % (self._server_address,), - data=self._serialize_event(event, topic.getName()), + data=self._serialize_event(event, topic_name), headers={"content-type": "application/json"}, verify=False, timeout=MEDIUM_REQUEST_TIMEOUT,