From 8535669d46651aa52a38a13d9a5577e7beb9e16f Mon Sep 17 00:00:00 2001 From: Zev Benjamin Date: Fri, 6 Dec 2013 15:50:59 -0500 Subject: [PATCH] socket: Include the user in socket close log lines (imported from commit fb5b9e54a07b6bfd85e913b8c97105305f8210eb) --- zerver/lib/socket.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/zerver/lib/socket.py b/zerver/lib/socket.py index 33b8765ad7..cec92bd4ff 100644 --- a/zerver/lib/socket.py +++ b/zerver/lib/socket.py @@ -204,8 +204,10 @@ class SocketConnection(sockjs.tornado.SockJSConnection): error_content=self.close_info.err_msg) else: deregister_connection(self) + email = self.session.user_profile.email \ + if self.session.user_profile is not None else 'unknown' write_log_line(log_data, path='/socket/close', method='SOCKET', - remote_ip=self.session.conn_info.ip, email='unknown', + remote_ip=self.session.conn_info.ip, email=email, client_name='?') def fake_message_sender(event):