Include the path info in the logging messages in WSRoute.

This commit is contained in:
Fabio Manganiello 2023-05-08 12:35:54 +02:00
parent 3fc622e296
commit 2d4b179879
Signed by: blacklight
GPG Key ID: D90FBA7F76362774
1 changed files with 3 additions and 2 deletions

View File

@ -32,7 +32,7 @@ class WSRoute(WebSocketHandler, Thread, ABC):
@override
def open(self, *_, **__):
logger.info('Started websocket connection with %s', self.request.remote_ip)
logger.info('Client %s connected to %s', self.request.remote_ip, self.path())
self.name = f'ws:{self.app_name()}@{self.request.remote_ip}'
self.start()
@ -97,8 +97,9 @@ class WSRoute(WebSocketHandler, Thread, ABC):
self._sub.close()
logger.info(
'Websocket connection to %s closed, reason=%s, message=%s',
'Client %s disconnected from %s, reason=%s, message=%s',
self.request.remote_ip,
self.path(),
self.close_code,
self.close_reason,
)