agents icon indicating copy to clipboard operation
agents copied to clipboard

Logging configuration for LiveKit Agents: avoid JSON stdout in production mode

Open dhansmair opened this issue 1 month ago • 0 comments

Feature Type

Would make my life easier

Feature Description

Hi there,

I’m exploring how logging in LiveKit Agents can be configured. In production mode, the worker outputs JSON-formatted logs to stdout. Our project would prefer plain-text (non-JSON) logging.

Context:

  • I inspected the source and found that LiveKit attaches a separate handler to the root logger.
  • To tailor logging for our needs, I would need to attach our own handler to the root logger and remove the JSON handler. However, the JSON handler is only attached when cli.run_app is called. This means it cannot be removed except from within the entrypoint function, in which case there will be a period during which logs are emitted in JSON format.

Questions:

  • What is the recommended, clean, and “unhacky” way to solve this?
  • The conventional approach for Python libraries is to maintain their own scoped loggers. What is the motivation for attaching the handler directly to the root logger, rather than to a library-specific logger such as "livekit" or "livekit.agents"?

Best regards, David

Workarounds / Alternatives

No response

Additional Context

No response

dhansmair avatar Dec 19 '25 18:12 dhansmair