Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-47020

Connection accepted and ended messages

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 6.1.0-rc0
    • Affects Version/s: None
    • Component/s: Logging
    • Fully Compatible
    • ALL
    • Service Arch 2022-05-30

      Connection accepted and connection ended messages

      A "connection accepted" message lists a "sessionId" which seems to be the connection number:

      {
          "_id": 45,
          "t": "2020-03-20T13:42:08.056Z",
          "s": "I",
          "c": "NETWORK",
          "id": 22943,
          "ctx": "listener",
          "msg": "connection accepted",
          "attr": {
              "remote": "127.0.0.1:46262",
              "sessionId": 1,
              "connectionCount": 1
          }
      }
      

      However the "connection ended" message does not, and it has to be parsed from the ctx "conn", which seems contrary to the goals of structured logging:

      {
          "_id": 84,
          "t": "2020-03-20T13:42:08.113Z",
          "s": "I",
          "c": "NETWORK",
          "id": 22944,
          "ctx": "conn1",
          "msg": "connection ended",
          "attr": {
              "remote": "127.0.0.1:46262",
              "connectionCount": 1
          }
      }
      

      Can the "sessionId" be logged in the "connection ended" message? Alternatively can the "ctx" for the new connection be logged in the "connection accepted" message? The latter is actually possibily better since it allows all kinds of messages, not just the "connection ended" message, to be related back to the "connection accepted" message.

      Also would "connectionId" be a better name than "sessionId" - it seems the latter can be confused with logical session ids used in transactions?

      Minor point: "Connection ended" and "Connection accepted" should be capitalized

            Assignee:
            reo.kimura@mongodb.com Reo Kimura (Inactive)
            Reporter:
            bruce.lucas@mongodb.com Bruce Lucas (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: