# Sentry Python logs: breadcrumbs, Logs product, and before_send_log

## Three different things

1. **Breadcrumbs** (default on): the Logging integration records log lines as breadcrumbs attached to error events. Free context, no extra quota beyond the error itself.
2. **Logs product**: structured logs sent to Sentry as their own data type, searchable and correlatable with errors. This is the opt-in product you enable in init.
3. **before_send_log** (SDK 2.35.0+): a hook called for each log; return None to drop it, or mutate it.

```python
def before_send_log(log, hint):
    if "healthcheck" in log.get("message", ""):
        return None  # drop noisy logs before they bill
    return log

sentry_sdk.init(
    dsn="___PUBLIC_DSN___",
    before_send_log=before_send_log,
)
```

## The volume trap

Logs are their own quota category. Enabling the Logs product on a chatty app without a filter is the logs version of traces_sample_rate=1.0. Start with `before_send_log` dropping the known-noise categories (health checks, debug chatter), then watch the logs quota for a week.

## Breadcrumb noise

If breadcrumbs are full of framework debug logs, raise the logger level for the noisy logger rather than disabling the Logging integration. Breadcrumbs on the error that matters are worth more than a quiet breadcrumb trail on every event.

## Verify

Emit a log line at error level from a file (not a REPL), trigger it, and confirm it appears both as a breadcrumb on the issue and in the Logs view if the product is enabled. If logs appear but errors do not, your log pipeline is fine and the problem is in error capture, not transport.