Skip to content

Commit 9800929

Browse files
committed
better logs
1 parent e2c8f4c commit 9800929

File tree

1 file changed

+8
-7
lines changed
  • services/web/server/src/simcore_service_webserver/socketio

1 file changed

+8
-7
lines changed

services/web/server/src/simcore_service_webserver/socketio/_handlers.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,6 @@ async def _handler(request: web.Request) -> tuple[UserID, ProductName, str]:
7474

7575
# REDIS wrapper
7676
with managed_resource(user_id, client_session_id, app) as resource_registry:
77-
_logger.info(
78-
"socketio connection from user %s",
79-
user_id,
80-
extra=get_log_record_extra(user_id=user_id),
81-
)
8277
await resource_registry.set_socket_id(socket_id)
8378

8479
return user_id, product.name, client_session_id
@@ -129,10 +124,16 @@ async def connect(
129124
user_id, product_name, client_session_id = await auth_user_handler(
130125
environ["aiohttp.request"]
131126
)
127+
_logger.info(
128+
"%s successfully connected with %s",
129+
f"{user_id=}",
130+
f"{client_session_id=}",
131+
extra=get_log_record_extra(user_id=user_id),
132+
)
132133

133134
await _set_user_in_group_rooms(app, user_id, socket_id)
134135

135-
_logger.info("Sending set_heartbeat_emit_interval with %s", _EMIT_INTERVAL_S)
136+
_logger.debug("Sending set_heartbeat_emit_interval with %s", _EMIT_INTERVAL_S)
136137

137138
await emit(
138139
app, "SIGNAL_USER_CONNECTED", user_id, app, product_name, client_session_id
@@ -170,7 +171,7 @@ async def disconnect(socket_id: SocketID, app: web.Application) -> None:
170171
with log_context(
171172
_logger,
172173
logging.INFO,
173-
"disconnection of %s for %s",
174+
"disconnection of %s with %s",
174175
f"{user_id=}",
175176
f"{client_session_id=}",
176177
):

0 commit comments

Comments
 (0)