[real-time] only log userId from session (#24281)

While we are at it, log projectId and transport.

GitOrigin-RevId: ac10220247947e0050f1374c81091c50c8cc0e85
This commit is contained in:
Jakob Ackermann 2025-03-13 07:51:51 +00:00 committed by Copybot
parent 2d48c86e61
commit 8d569815e6

View file

@ -216,18 +216,6 @@ module.exports = Router = {
})
metrics.gauge('socket-io.clients', io.sockets.clients().length)
const info = {
session,
publicId: client.publicId,
clientId: client.id,
isDebugging,
}
if (isDebugging) {
logger.info(info, 'client connected')
} else {
logger.debug(info, 'client connected')
}
let user
if (session && session.passport && session.passport.user) {
;({ user } = session.passport)
@ -238,6 +226,20 @@ module.exports = Router = {
user = { _id: 'anonymous-user', anonymousAccessToken }
}
const info = {
userId: user._id,
projectId,
transport: client.transport,
publicId: client.publicId,
clientId: client.id,
isDebugging,
}
if (isDebugging) {
logger.info(info, 'client connected')
} else {
logger.debug(info, 'client connected')
}
const connectionDetails = {
userId: user._id,
projectId,