From 1ad134a53867345c91afbb326965bd25e327d298 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Wed, 2 Sep 2020 20:50:19 -0400 Subject: [PATCH] PadMessageHandler: Improve logging of pre-CLIENT_READY drops This should make it easier to see what is emitting the the messages so it can be fixed. --- src/node/handler/PadMessageHandler.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/node/handler/PadMessageHandler.js b/src/node/handler/PadMessageHandler.js index 174a6bc5f..d2f6fc7ba 100644 --- a/src/node/handler/PadMessageHandler.js +++ b/src/node/handler/PadMessageHandler.js @@ -210,8 +210,11 @@ exports.handleMessage = async (socket, message) => { const auth = thisSession.auth; if (!auth) { - console.error('Auth was never applied to a session. If you are using the ' + - 'stress-test tool then restart Etherpad and the Stress test tool.'); + const ip = settings.disableIPlogging ? 'ANONYMOUS' : (socket.request.ip || ''); + const msg = JSON.stringify(message, null, 2); + messageLogger.error(`Dropping pre-CLIENT_READY message from IP ${ip}: ${msg}`); + messageLogger.debug( + 'If you are using the stress-test tool then restart Etherpad and the Stress test tool.'); return; }