Logging stats per user

Each user sees their own stats, including upload/download bitrate, packet loss, resolution, and framerate. What I want to do is log these stats per user over time.

For example, say there’s users X, Y, and Z, and I want to log packet loss and resolution. At the end of the call the server should have (3*2=)6 files:
logs/X/packet_loss.txt
logs/X/resolution.txt
logs/Y/packet_loss.txt
logs/Y/resolution.txt
logs/Z/packet_loss.txt
logs/Z/resolution.txt

Where in the repo can I implement this?

You can attach your listener like this: https://github.com/jitsi/jitsi-meet/blob/162a67fe8b55c675abb9335113fcd9556720420d/react/features/connection-indicator/statsEmitter.js#L32 and push the stats to your endpoint that will store them.