This question originally came up in our Slack community and the thread has been consolidated here for long-term reference.
How do I track logs for a specific agent worker via room name?
The logs through lk agent tail show mixed logs for all workers of an agent, and sometimes activity randomly stops appearing in logs.
Add log context fields to include the room name in all log entries:
ctx.log_context_fields = {
"room": ctx.room.name,
}
See the example:
This allows you to filter logs by room name to track a specific session.