From d2085c1269944d3811ea7a39c81c4441923f4c39 Mon Sep 17 00:00:00 2001 From: ansuz Date: Fri, 30 Jun 2017 11:19:12 +0200 Subject: [PATCH] enable logging of rpc calls --- config.example.js | 5 +++++ rpc.js | 1 + 2 files changed, 6 insertions(+) diff --git a/config.example.js b/config.example.js index d2ea25a3e..da000a519 100644 --- a/config.example.js +++ b/config.example.js @@ -277,6 +277,11 @@ module.exports = { */ //logFeedback: true, + /* If you wish to see which remote procedure calls clients request, + * set this to true + */ + //logRPC: true, + /* it is recommended that you serve CryptPad over https * the filepaths below are used to configure your certificates */ diff --git a/rpc.js b/rpc.js index 1df16b8f9..d00ee93b7 100644 --- a/rpc.js +++ b/rpc.js @@ -944,6 +944,7 @@ RPC.create = function (config /*:typeof(ConfigType)*/, cb /*:(?Error, ?Function) if (!Env.msgStore) { Env.msgStore = ctx.store; } var handleMessage = function (privileged) { + if (config.logRPC) { console.log(msg[0]); } switch (msg[0]) { case 'COOKIE': return void Respond(void 0); case 'RESET':