diff --git a/monkey/monkey_island/cc/resources/island_logs.py b/monkey/monkey_island/cc/resources/island_logs.py index 3e37e1748..bb10215fe 100644 --- a/monkey/monkey_island/cc/resources/island_logs.py +++ b/monkey/monkey_island/cc/resources/island_logs.py @@ -3,7 +3,6 @@ from pathlib import Path from monkey_island.cc.resources.AbstractResource import AbstractResource from monkey_island.cc.resources.request_authentication import jwt_required -from monkey_island.cc.services.island_logs import IslandLogService logger = logging.getLogger(__name__) @@ -17,6 +16,11 @@ class IslandLog(AbstractResource): @jwt_required def get(self): try: - return IslandLogService.get_log_file() + return self._get_log_file_contents() except Exception: logger.error("Monkey Island logs failed to download", exc_info=True) + + def _get_log_file_contents(self): + with open(self._island_log_file_path, "rt") as f: + log_file = f.read() + return {"log_file": log_file}