Can I use the same logger the livekit agents use?
# ask-ai
a
Can I use the same logger the livekit agents use?
t
Thanks for reaching out, Ahron. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I’m responding to your question about whether you can use the same logger LiveKit Agents use. Yes — you can use the same logging approach LiveKit Agents use, and you have a few straightforward options depending on your environment: • Python agents: Use the built-in
logging
module (e.g.,
logger = logging.getLogger("myAgent")
). That integrates with standard Python log consumers and sinks. • Node.js agents: Use the
@livekit/agents
logger (
import { log } from '@livekit/agents'; log().info(...)
) so your code emits the same structured logs. • Client-side (browser) apps: Use
setLogExtension()
from the LiveKit JavaScript SDK to receive SDK log messages and forward them to your own logger or monitoring system:
Copy code
import { setLogExtension } from 'livekit-client';
  setLogExtension((level, msg, context) => {
    // forward to your logging system
  });
• External forwarding / observability: When running on LiveKit Cloud, logs can be forwarded to providers like Datadog, CloudWatch, Sentry, or New Relic by configuring the appropriate secrets. Agent logs are also available in the Agent Insights tab of the dashboard (requires compatible SDK versions and Agent Observability enabled), and can be downloaded as JSON. If you’d like, tell me: • Which runtime are you using (Python, Node.js, browser)? • Are you running agents on LiveKit Cloud or self-hosted? • Which external logging/monitoring provider (if any) do you want to forward logs to? I can then give concrete setup steps or an example config for your environment. Sources: Where to find your Agent Logs | LiveKit | How to Send Logs from the JavaScript SDK to External Providers | LiveKit