You could either:
client.execute()), and logs arguments. If using Node.js v6+, this could be a nice use case for an ES2015
Proxyobject. This is the safest, non intrusive approach.
client.prototype.messageStreammethod, and log parameters. As of v2.3.2, this low level method gets called whether you're doing
client.stream(). This is riskier and trickier.
Quick and dirty: edit the source code in
./node_modules/gremlin/lib/GremlinClient.js and add this after line 405 (
console.log('query:', script); console.log('params:', bindings);
There's currently an open issue about logging of ingoing messages but this could be developed to include outgoing messages as well (queries with parameters, down to protocol messages).