Skip to content

lk agent dev/console: log level cannot be set via environment variable; console mode has no --log-level flag #934

Description

@kaushal-aubie

Describe the bug

With the deprecation of python agent.py console/dev in favor of lk agent dev / lk agent console (per the 1.6.8 release notes, #6656), the new Go-based CLI only supports setting log level via the --log-level flag on lk agent dev. There is no environment variable equivalent (e.g. LIVEKIT_LOG_LEVEL, LOG_LEVEL), which the old Python CLI workflow relied on. This is also tracked as a general feature request in livekit/agents#4340, but it especially affects the new lk agent commands since they are now the recommended entrypoint.

Additionally, lk agent console does not expose a --log-level flag at all (per the CLI docs: https://docs.livekit.io/reference/developer-tools/livekit-cli/agent/#console), so there is currently no supported way to reduce verbosity in console mode.

To Reproduce

  1. Run lk agent dev (or lk agent console) in a project.
  2. Set LIVEKIT_LOG_LEVEL=info (or similar) in the environment.
  3. Observe that DEBUG-level logs are still printed.
  4. Attempt to pass --log-level to lk agent console — flag does not exist.

Expected behavior

  • lk agent dev should respect a LIVEKIT_LOG_LEVEL (or similar) environment variable, consistent with how deployed agents on LiveKit Cloud already do (per https://docs.livekit.io/deploy/agents/logs/#log-levels).
  • lk agent console should support a --log-level flag (or the same environment variable) so verbosity can be controlled locally, matching lk agent dev.

Environment

  • lk CLI version: <fill in your lk --version output>
  • OS:
  • livekit-agents version:

Additional context
Related: livekit/agents#4340 (log level via env var / ServerOptions)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions