faint-arm-51818
10/02/2025, 3:08 PMtall-airline-16756
10/02/2025, 3:08 PMtall-airline-16756
10/02/2025, 3:09 PMsetLoggingLevel function with a predefined LoggerLevel value. For example:
`setLoggingLevel(LoggerLevel.kINFO);`If you want to disable logging altogether, just use:
disableLogging();
• LiveKit React Native SDK: Simply use the setLogLevel function with levels like "debug", "info", and so on. For example:
setLogLevel("debug");
• LiveKit Android SDK: You can modify the loggingLevel property on the LiveKit object like this:
LiveKit.loggingLevel = LoggingLevel.DEBUG;
• LiveKit Agents (Node.js/Python): When starting the agent, set the log level via the command line:
`pnpm run start --log-level=debug`For Python, you also have the option to configure logging using the standard logging module:
logger = logging.getLogger("your_logger_name")
logger.setLevel(logging.DEBUG)
• Dockerized Agent Workers: You can set the log level right in your Dockerfile like this:
CMD ["python", "agent.py", "start", "--log-level=DEBUG"]
• Other LiveKit Services: Use the --log-level flag with options such as debug, info, etc. For example:
--log-level=debug
If you’d like, just tell me which SDK or service you’re using, and I’ll be more than happy to walk you through the exact steps. I’m here to help!
Sources: docs/functions/setLogLevel.html | livekit-android-sdk/src/main/java/io/livekit/android/LiveKit.kt | Docs::Agents | pipeline-tts/elevenlabs_change_speed.py | Log collection | LiveKit Docsfaint-arm-51818
10/02/2025, 3:21 PMtall-airline-16756
10/02/2025, 3:22 PMlogging module:
import logging
# Create a logger
logger = logging.getLogger("livekit_agent")
# Set the logging level to DEBUG
logger.setLevel(logging.DEBUG)
# Create a console handler and set its level
console_handler = logging.StreamHandler()
console_handler.setLevel(logging.DEBUG)
# Create a formatter and add it to the handler
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
console_handler.setFormatter(formatter)
# Add the handler to the logger
logger.addHandler(console_handler)
# Example log message
logger.debug("This is a debug message")
• Setting the log level via command line:
When you start the agent, you can easily specify the log level like this:
python agent.py start --log-level=DEBUG
• Dockerized Agent Workers:
If you're running the agent inside a Docker container, you can set the log level right in the Dockerfile:
CMD ["python", "agent.py", "start", "--log-level=DEBUG"]
If anything’s unclear or if you’d like me to walk you through more examples, just let me know—I’m here to help!faint-arm-51818
10/02/2025, 3:23 PMtall-airline-16756
10/02/2025, 3:23 PMimport logging
# Create a logger for LiveKit
livekit_logger = logging.getLogger("livekit_agent")
# Set the logging level to WARNING
livekit_logger.setLevel(logging.WARNING)
# Example: Your own logger remains unaffected
my_logger = logging.getLogger("my_application")
my_logger.setLevel(logging.DEBUG)
my_logger.debug("This is my own debug message")
• Command-line option:
When you start the agent, simply set the log level to WARNING to keep those lower-level logs at bay:
python agent.py start --log-level=WARNING
• Dockerized setup:
If you’re running this with Docker, you can set the log level right in your Dockerfile like this:
CMD ["python", "agent.py", "start", "--log-level=WARNING"]
By setting things up this way, only logs at the WARNING level or higher (like ERROR and CRITICAL) will show from LiveKit. This should make it much easier for you to focus on your own logs without extra noise. If you need any more help, just let me know—I’m here for you!