Debugging

To get some information on what monk is doing, use the monk-middleware-debug:

npm install --save monk-middleware-debug
db.addMiddleware(require('monk-middleware-debug'))
  • If you wish to see what queries monk passes to the driver, simply leverage debug:

    DEBUG="monk:query" npm start
    
  • To see all debugging output from monk:

    DEBUG="monk:*" npm start
    
  • You can also see the output from the mongo driver using debug:

    DEBUG="mongo:*" npm start
    

    There are several separated features available on this namespace:

    • Db: The Db instance log statements
    • Server: A server instance (either standalone, a mongos or replicaset member)
    • ReplSet: Replicaset related log statements
    • Mongos: Mongos related log statements
    • Cursor: Cursor log statements
    • Pool: Connection Pool specific log statements
    • Connection: Singular connection specific log statements
    • Ping: Replicaset ping inquiry log statements

    To see the output of only one of those features:

    DEBUG="mongo:Cursor" npm start // will only print the Cursor log statements
    

results matching ""

    No results matching ""