Still dealing with double and triple logging, anyone else have this problem?

All my logs print twice, for example:

[2026-04-02 09:51:59,080][INFO] draining worker
{“message”: “draining worker”, “level”: “INFO”, “name”: “livekit.agents”, “id”: “AW_fKpvtY2D93XK”, “timeout”: 1800, “timestamp”: “2026-04-02T15:51:59.080390+00:00”}```

^ 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:

[2026-04-02 09:48:09,793\]\[INFO\] current session successfully settled! end_timestamp updated!
[2026-04-02 09:48:09,793\]\[INFO\] current session successfully settled! end_timestamp updated!
{“message”: “current session successfully settled! end_timestamp updated!”, “level”: “INFO”, “name”: “agent”, “pid”: 95307, “job_id”: “AJ_KU3uCainNmDq”, “room_id”: “RM_STKbL233SPWX”, “timestamp”: “2026-04-02T15:48:09.793310+00:00”}

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.

I’m considering just not declaring a logger. I don’t use basicConfig anywhere. Here’s my logger declaration:
```

logger = logging.getLogger(“agent”)

logger.setLevel(logging.INFO)

# logger.propagate = False # Using this line: none of my logs print.
```

and my startup script when I’m testing locally


set -a && source .env.local && set +a && PYTHONPATH=. python3 voice-agent-runtime/agent.py start --log-level=info
```

I’ve tried omitting --log-level=info in the startup script, it has no effect.

@CWilson please advise, I think we’re close to a solution here.

Are you getting duplicate logs if you run this basic agent?

I figured it out; this may be useful to some folks. Livekit configures the root logger, so we must configure a separate one:
```

logger = logging.getLogger(“agent”)

logger.setLevel(logging.INFO)

logger.propagate = False # don’t bubble up to root (and LiveKit’s handler)

handler = logging.StreamHandler()

handler.setFormatter(logging.Formatter(“[%(asctime)s][%(levelname)s] %(message)s”))

logger.addHandler(handler)


2 Likes