From d81195856abdf5fea742525d633ad83f49abf9d3 Mon Sep 17 00:00:00 2001 From: John Crepezzi Date: Wed, 14 Dec 2016 14:31:18 -0500 Subject: [PATCH] Log ip --- lib/document_handler.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/document_handler.js b/lib/document_handler.js index 68985ec..7a1eca0 100644 --- a/lib/document_handler.js +++ b/lib/document_handler.js @@ -69,7 +69,8 @@ DocumentHandler.prototype.handlePost = function (request, response) { _this.chooseKey(function (key) { _this.store.set(key, buffer, function (res) { if (res) { - winston.verbose('added document', { key: key }); + var ip = request.headers['X-Forwarded-For'] || request.ip; + winston.verbose('added document', { key: key, ip: ip }); response.writeHead(200, { 'content-type': 'application/json' }); response.end(JSON.stringify({ key: key })); }