# Logging and Telemetry

## Logging

By default, Mastra emits logs locally to the `/logs` directory.

## Log drains

To send logs to an external service, you can configure a log drain in your Mastra config file. Currently, we support [Upstash](https://upstash.com/).

```ts filename="mastra.config.ts" showLineNumbers copy
export const config: Config = {
  ...mastraConfig,
  logs: {
    provider: "UPSTASH",
    config: {
      url: process.env.UPSTASH_URL!,
      token: process.env.UPSTASH_API_KEY!,
    },
  },
};
```

## Tracing

Mastra will (very soon) emit tracing data using the OpenTelemetry Node.js SDK and following the OpenTelemetry standard.
