Python has a built in solution for this. This is an example implementation:
import logging
logger = logging.getLogger(__name__)
...
def build_first_load_context_and_template(self, data):
if settings.INERTIA_SSR_ENABLED:
try:
...
except Exception:
logger.exception("Error while calling ssr render endpoint.")
Originally posted by @svengt in #61 (comment)