socket: Include the user in socket close log lines

(imported from commit fb5b9e54a07b6bfd85e913b8c97105305f8210eb)
This commit is contained in:
Zev Benjamin 2013-12-06 15:50:59 -05:00
parent f55067a3db
commit 8535669d46
1 changed files with 3 additions and 1 deletions

View File

@ -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):