Skip to content

[app] per-event logging #2821

@cfm

Description

@cfm

@legoktm suggests logging the result of each event returned in a BatchResponse for easier debugging at the event as opposed to the request/response level.

Example

BatchRequest

{
  ...
  "events": [
    {
      "id": "0001",
      "type": "REPLY_SENT",
      "target": {
        "source_uuid": "11111111-2222-3333-4444-555555555555",
        "version": "9f36a1"
      },
      "data": {
        "uuid": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
        "reply": "Thanks for your submission. We will follow up."
      }
    },
    {
      "id": "0002",
      "type": "SOURCE_DELETED",
      "target": {
        "source_uuid": "66666666-7777-8888-9999-000000000000",
        "version": "1a63f9"
      }
    }
  ]
}

BatchResponse

{
  ...
  "events": {
    "0001": [
      200,
      null
    ],
    "0002": [
      409,
      "version mismatch"
    ]
  }
}

Logging

Could be more structured than this. The nice thing is that event IDs can be correlated between the client's and the server's traces for the same request.

Event 0001 reply_sent=OK source=11111111-2222-3333-4444-555555555555
Event 0002 source_deleted=Conflict source=66666666-7777-8888-9999-000000000000

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions