Minor fixes, logging, metrics
This commit is contained in:
parent
13585a5e6a
commit
24a13c12cf
3 changed files with 38 additions and 51 deletions
|
|
@ -229,7 +229,15 @@ class IOServer {
|
|||
|
||||
LOGGER.info('Accepted socket from %s', socket.context.ipAddress);
|
||||
counters.add('socket.io:accept', 1);
|
||||
socket.once('disconnect', () => counters.add('socket.io:disconnect', 1));
|
||||
socket.once('disconnect', (reason, reasonDetail) => {
|
||||
LOGGER.info(
|
||||
'%s disconnected (%s%s)',
|
||||
socket.context.ipAddress,
|
||||
reason,
|
||||
reasonDetail ? ` - ${reasonDetail}` : ''
|
||||
);
|
||||
counters.add('socket.io:disconnect', 1);
|
||||
});
|
||||
|
||||
const user = new User(socket, socket.context.ipAddress, socket.context.user);
|
||||
if (socket.context.user) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue