prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  Health check endpoint should log all the service status as it queries
  Currently the `/health` endpoint queries Cosmos / Service Bus / the RP - and returns the statuses. If any are not ok, the response is a 503.
  
  There is currently no way to query that endpoint when the gateway has blocked access - so we at least need it to log the results so we can track back and see what service was down, when.
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `api_app/api/routes/health.py`
  Content:
  ```
  1 from fastapi import APIRouter
  2 from models.schemas.status import HealthCheck, ServiceStatus, StatusEnum
  3 from resources import strings
  4 from services.health_checker import create_resource_processor_status, create_state_store_status, create_service_bus_status
  5 from fastapi import HTTPException, status
  6 
  7 router = APIRouter()
  8 
  9 
  10 @router.get("/health", name=strings.API_GET_HEALTH_STATUS)
  11 async def health_check() -> HealthCheck:
  12     cosmos_status, cosmos_message = create_state_store_status()
  13     sb_status, sb_message = await create_service_bus_status()
  14     rp_status, rp_message = create_resource_processor_status()
  15     services = [ServiceStatus(service=strings.COSMOS_DB, status=cosmos_status, message=cosmos_message),
  16                 ServiceStatus(service=strings.SERVICE_BUS, status=sb_status, message=sb_message),
  17                 ServiceStatus(service=strings.RESOURCE_PROCESSOR, status=rp_status, message=rp_message)]
  18     health_check_result = HealthCheck(services=services)
  19     if cosmos_status == StatusEnum.not_ok or sb_status == StatusEnum.not_ok or rp_status == StatusEnum.not_ok:
  20         raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail=health_check_result.json())
  21     return health_check_result
  22
  ```
  
  Path: `api_app/_version.py`
  Content:
  ```
  1 __version__ = "0.2.10"
  2
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/api_app/_version.py b/api_app/_version.py
  --- a/api_app/_version.py
  +++ b/api_app/_version.py
  @@ -1 +1 @@
  -__version__ = "0.2.10"
  +__version__ = "0.2.11"
  diff --git a/api_app/api/routes/health.py b/api_app/api/routes/health.py
  --- a/api_app/api/routes/health.py
  +++ b/api_app/api/routes/health.py
  @@ -3,6 +3,7 @@
   from resources import strings
   from services.health_checker import create_resource_processor_status, create_state_store_status, create_service_bus_status
   from fastapi import HTTPException, status
  +import logging
   
   router = APIRouter()
   
  @@ -17,5 +18,8 @@
                   ServiceStatus(service=strings.RESOURCE_PROCESSOR, status=rp_status, message=rp_message)]
       health_check_result = HealthCheck(services=services)
       if cosmos_status == StatusEnum.not_ok or sb_status == StatusEnum.not_ok or rp_status == StatusEnum.not_ok:
  +        logging.error(f'Cosmos Status: {cosmos_status}, message: {cosmos_message}')
  +        logging.error(f'Service Bus Status: {sb_status}, message: {sb_message}')
  +        logging.error(f'Resource Processor Status: {rp_status}, message: {rp_message}')
           raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail=health_check_result.json())
       return health_check_result
  
verification_info: {"golden_diff": "diff --git a/api_app/_version.py b/api_app/_version.py\n--- a/api_app/_version.py\n+++ b/api_app/_version.py\n@@ -1 +1 @@\n-__version__ = \"0.2.10\"\n+__version__ = \"0.2.11\"\ndiff --git a/api_app/api/routes/health.py b/api_app/api/routes/health.py\n--- a/api_app/api/routes/health.py\n+++ b/api_app/api/routes/health.py\n@@ -3,6 +3,7 @@\n from resources import strings\n from services.health_checker import create_resource_processor_status, create_state_store_status, create_service_bus_status\n from fastapi import HTTPException, status\n+import logging\n \n router = APIRouter()\n \n@@ -17,5 +18,8 @@\n                 ServiceStatus(service=strings.RESOURCE_PROCESSOR, status=rp_status, message=rp_message)]\n     health_check_result = HealthCheck(services=services)\n     if cosmos_status == StatusEnum.not_ok or sb_status == StatusEnum.not_ok or rp_status == StatusEnum.not_ok:\n+        logging.error(f'Cosmos Status: {cosmos_status}, message: {cosmos_message}')\n+        logging.error(f'Service Bus Status: {sb_status}, message: {sb_message}')\n+        logging.error(f'Resource Processor Status: {rp_status}, message: {rp_message}')\n         raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail=health_check_result.json())\n     return health_check_result\n", "issue": "Health check endpoint should log all the service status as it queries\nCurrently the `/health` endpoint queries Cosmos / Service Bus / the RP - and returns the statuses. If any are not ok, the response is a 503.\r\n\r\nThere is currently no way to query that endpoint when the gateway has blocked access - so we at least need it to log the results so we can track back and see what service was down, when.\n", "before_files": [{"content": "from fastapi import APIRouter\nfrom models.schemas.status import HealthCheck, ServiceStatus, StatusEnum\nfrom resources import strings\nfrom services.health_checker import create_resource_processor_status, create_state_store_status, create_service_bus_status\nfrom fastapi import HTTPException, status\n\nrouter = APIRouter()\n\n\n@router.get(\"/health\", name=strings.API_GET_HEALTH_STATUS)\nasync def health_check() -> HealthCheck:\n    cosmos_status, cosmos_message = create_state_store_status()\n    sb_status, sb_message = await create_service_bus_status()\n    rp_status, rp_message = create_resource_processor_status()\n    services = [ServiceStatus(service=strings.COSMOS_DB, status=cosmos_status, message=cosmos_message),\n                ServiceStatus(service=strings.SERVICE_BUS, status=sb_status, message=sb_message),\n                ServiceStatus(service=strings.RESOURCE_PROCESSOR, status=rp_status, message=rp_message)]\n    health_check_result = HealthCheck(services=services)\n    if cosmos_status == StatusEnum.not_ok or sb_status == StatusEnum.not_ok or rp_status == StatusEnum.not_ok:\n        raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail=health_check_result.json())\n    return health_check_result\n", "path": "api_app/api/routes/health.py"}, {"content": "__version__ = \"0.2.10\"\n", "path": "api_app/_version.py"}], "after_files": [{"content": "from fastapi import APIRouter\nfrom models.schemas.status import HealthCheck, ServiceStatus, StatusEnum\nfrom resources import strings\nfrom services.health_checker import create_resource_processor_status, create_state_store_status, create_service_bus_status\nfrom fastapi import HTTPException, status\nimport logging\n\nrouter = APIRouter()\n\n\n@router.get(\"/health\", name=strings.API_GET_HEALTH_STATUS)\nasync def health_check() -> HealthCheck:\n    cosmos_status, cosmos_message = create_state_store_status()\n    sb_status, sb_message = await create_service_bus_status()\n    rp_status, rp_message = create_resource_processor_status()\n    services = [ServiceStatus(service=strings.COSMOS_DB, status=cosmos_status, message=cosmos_message),\n                ServiceStatus(service=strings.SERVICE_BUS, status=sb_status, message=sb_message),\n                ServiceStatus(service=strings.RESOURCE_PROCESSOR, status=rp_status, message=rp_message)]\n    health_check_result = HealthCheck(services=services)\n    if cosmos_status == StatusEnum.not_ok or sb_status == StatusEnum.not_ok or rp_status == StatusEnum.not_ok:\n        logging.error(f'Cosmos Status: {cosmos_status}, message: {cosmos_message}')\n        logging.error(f'Service Bus Status: {sb_status}, message: {sb_message}')\n        logging.error(f'Resource Processor Status: {rp_status}, message: {rp_message}')\n        raise HTTPException(status_code=status.HTTP_503_SERVICE_UNAVAILABLE, detail=health_check_result.json())\n    return health_check_result\n", "path": "api_app/api/routes/health.py"}, {"content": "__version__ = \"0.2.11\"\n", "path": "api_app/_version.py"}]}