Skip to content

Health Check API: log request and responses #700

Description

@josecelano

Parent issue: #687
Relates to: torrust/torrust-index#468

Log Health Check API requests and responses:

Request:

$ curl -i http://127.0.0.1:1313/health_check
HTTP/1.1 200 OK
content-type: application/json
content-length: 424
date: Mon, 19 Feb 2024 10:34:01 GMT

Response:

{
  "status": "Ok",
  "message": "",
  "details": [
    {
      "binding": "0.0.0.0:6969",
      "info": "checking the udp tracker health check at: 0.0.0.0:6969",
      "result": {
        "Ok": "Connected"
      }
    },
    {
      "binding": "127.0.0.1:1212",
      "info": "checking api health check at: http://127.0.0.1:1212/api/health_check",
      "result": {
        "Ok": "200 OK"
      }
    },
    {
      "binding": "0.0.0.0:7070",
      "info": "checking http tracker health check at: http://0.0.0.0:7070/health_check",
      "result": {
        "Ok": "200 OK"
      }
    }
  ]
}

Log:

2024-02-19T11:30:21.061293933+00:00 [HEALTH CHECK API][INFO] request; method=GET uri=/health_check request_id=78933bbf-c4cf-4897-b972-4c0fd252159a
2024-02-19T11:30:21.070329733+00:00 [HEALTH CHECK API][INFO] response; latency=9 status=200 OK request_id=78933bbf-c4cf-4897-b972-4c0fd252159a

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions