code: def log_exception(request: Request, exc_info: t.Any) -> None:
      """
      Logs an exception.  This is called by :meth:`handle_exception`
      if debugging is disabled and right before the handler is called.
      The default implementation logs the exception as error on the
      :attr:`logger`.
      """
      logger.error(
          "Exception on %s [%s]",
          request.url.path,
          request.method,
          exc_info=exc_info,
      )
  
imports: from __future__ import annotations
  import asyncio
  import functools
  import logging
  import os
  import sys
  import typing
  from simple_di import Provide
  from simple_di import inject
  from starlette.exceptions import HTTPException
  from starlette.responses import PlainTextResponse
  from ...exceptions import BentoMLException
  from ..configuration.containers import BentoMLContainer
  from ..context import trace_context
  from ..server.base_app import BaseAppFactory
  from ..service.service import Service
label_desc: Use image node_id 1 for calling a global function with example usage: log_exception(request, exc_info) without return types