diff --git a/src/openflexure_microscope_server/server/__init__.py b/src/openflexure_microscope_server/server/__init__.py index 2e1849bf..e9fa24bd 100644 --- a/src/openflexure_microscope_server/server/__init__.py +++ b/src/openflexure_microscope_server/server/__init__.py @@ -2,6 +2,7 @@ from __future__ import annotations +import json import logging import os from argparse import Namespace @@ -150,7 +151,8 @@ def serve_from_cli(argv: Optional[list[str]] = None) -> None: print(f"Error: {e}") # noqa: T201 print("Starting fallback server.") # noqa: T201 try: - log_history = OFM_HANDLER.log_history + # The log is a list of dicts, fallback server expects a string + log_history = json.dumps(OFM_HANDLER.log_history, indent=2) except BaseException: # If log history fails for any reason carry on. log_history = None