Optionally return log lines caused by a command on the command response

    • Type: Task
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Networking & Observability
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      Client applications would benefit from being able to know which log lines they caused through their commands in multiple ways. For example:

      • We have had requests from server teams to display deprecation warnings for specific features in mongosh. While we can add those on an ad-hoc basis, being able to directly display warnings as they are emitted in server logs would require the need to coordinate work across multiple tools. MONGOSH-2162 would be an example of this.
      • We would like to know if client-side applications use avoidable anti-patterns. In particular, for tools like mongosh and Compass, we want to check whether our integration tests cause unexpected server warnings to be generated. Being able to directly associate warnings with commands would make it easier to integrate this into our test runners.

      The API here (not prescriptive at all) could be something like a "$returnLogs: 1" flag on commands and a "logs: [...]" array similar to the return value of the getLog command. This feature would need to be gated behind the getLog privilege or a similar one.

            Assignee:
            Unassigned
            Reporter:
            Anna Henningsen
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated: