Uploaded image for project: 'Node.js Driver'
  1. Node.js Driver
  2. NODE-4685

Easier debugging with standardized logging: logging specification

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.2.0
    • Affects Version/s: None
    • Component/s: Logging
    • Labels:
      None
    • 3
    • 3
    • Hide

      DRIVERS-1677:
      I suggest that drivers do their implementation of this ticket in tandem with their implementation of DRIVERS-1673 which adds command log messages. This way the driver will have actual log messages to emit and test and can confirm that their logging implementation and test code works as expected.

      The logging spec can be found here.

      The unified test format changes can be found here. To summarize:

      • Client entities may now have a new observeLogMessages property specifying logging configuration for the client
      • Tests may now have a new expectLogMessages property specifying expected log messages to be produced during the test
      • Two new special matching operators $$matchAsRoot and $$matchAsDocument have been added to enable logging assertions.
         
      Show
      DRIVERS-1677 : I suggest that drivers do their implementation of this ticket in tandem with their implementation of DRIVERS-1673 which adds command log messages. This way the driver will have actual log messages to emit and test and can confirm that their logging implementation and test code works as expected. The logging spec can be found here . The unified test format changes can be found here . To summarize: Client entities may now have a new observeLogMessages property specifying logging configuration for the client Tests may now have a new expectLogMessages property specifying expected log messages to be produced during the test Two new special matching operators $$matchAsRoot and $$matchAsDocument have been added to enable logging assertions.  
    • Not Needed
    • Not Needed
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?

      This ticket was split from DRIVERS-1677, please see that ticket for a detailed description.

      This ticket is meant to implement changes to Unified spec test runner to support logging in order to
      facilitate the rest of the work for NODE-3974.

      Unknowns

      • What exactly should the failures for the CLAM spec tests look like?
        • See Testing Requirements

      Acceptance Criteria

      Implementation Requirements

      • Implement new operators
        • Implement $$matchAsRoot operator
        • Implement $$matchAsDocument operator
      • Implement matching and interpretation of new properties
        • Implement expectLogMessages property
        • Implement expectedLogMessages property
        • Implement expectedLogMessagesForClient property
        • Implement observeLogMessages property
      • Stub out mechanism for UnifiedMongoClient to be able to collect logs from MongoLogger

      Testing Requirements

      • Pull in the CLAM spec tests
      • Ensure that CLAM spec tests fail for "right reasons"
        • For tests that check for log messages using the new matching operators/properties, the tests should fail on the absence of the expected log messages and not because the test runner fails to recognize the new operators/properties.
      • Add unit tests for $$matchAsRoot and $$matchAsDocument operators

            Assignee:
            warren.james@mongodb.com Warren James
            Reporter:
            dbeng-pm-bot PM Bot
            Neal Beeken
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: