^ This is a livekit-generated log; it logs twice in 2 different formats
I’d be fine to just solve the duplicated log, but the bigger issue is when the session is running, all my logs print 3 times, for example, in on_shutdown I have some db write logic:
I’d love to know if anyone else is dealing with this issue. I’ve verified that my python agents code has no duplicate logger declaration, and I’ve verified that I am not accidentally running concurrent sessions.
This is making it extremely hard to debug my stuff; just imagine what large log prints look like. My terminal is so cluttered.
This usually happens when the agent server’s built-in structured logger and Python’s standard logging are both writing to stdout. The LiveKit logger emits JSON logs, while the default Python handler prints the [INFO]-style lines, so you see each event twice.
In dev mode, enhanced logging and reload behavior can also make duplication more noticeable. See Server startup modes for how logging defaults differ between dev and start.
To fix it, ensure you don’t add an extra root handler (for example via basicConfig) and avoid attaching handlers to both your module logger and the root logger. If you’re deploying on Cloud, note that all stdout/stderr is collected as runtime logs, as described in Log collection.