 						escapedLines.push line
 					client.join(doc_id)
 					callback null, escapedLines, version, ops
+					logger.log {user_id, project_id, doc_id, fromVersion, client_id: client.id}, "client joined doc"
 					
 	leaveDoc: (client, doc_id, callback = (error) ->) ->
 		Utils.getClientAttributes client, ["project_id", "user_id"], (error, {project_id, user_id}) ->

						logger.error {err: error, project_id, doc_id, client_id: client.id, version: update.v}, "document was not available for update"
						client.disconnect()
					callback(error)

			
	joinDoc: (client, doc_id, fromVersion = -1, callback = (error, doclines, version, ops) ->) ->
		Utils.getClientAttributes client, ["project_id", "user_id"], (error, {project_id, user_id}) ->
			return callback(error) if error?
			return callback(new Error("no project_id found on client")) if !project_id?
			logger.log {user_id, project_id, doc_id, fromVersion, client_id: client.id}, "client joining doc"
					
			AuthorizationManager.assertClientCanViewProject client, (error) ->
				return callback(error) if error?
				DocumentUpdaterManager.getDocument project_id, doc_id, fromVersion, (error, lines, version, ops) ->
					return callback(error) if error?
					# Encode any binary bits of data so it can go via WebSockets
