# Logs

> Centralized application logs, searchable in Grafana.

The logs add-on gives your app durable, searchable log storage in Grafana. It's the right tool for any log question that goes beyond "what just happened in the last 30 seconds."

## Attach it

```bash
watasu addons:create logs --app my-app
```

If this is your first observability add-on for the app, Watasu provisions a Grafana workspace at the same time. See [Observability Overview](https://docs.watasu.io/observability/overview.md).

## What you get

* a centralized logs data source in Grafana
* structured search by labels and free text
* long retention windows (plan-dependent — see [Add-on Plans](https://docs.watasu.io/reference/addon-plans.md))
* correlation with metrics and traces in the same Grafana

## When to use Grafana logs vs. `watasu logs`

| Question                                            | Tool                                |
| --------------------------------------------------- | ----------------------------------- |
| Did my last deploy boot?                            | `watasu logs`                       |
| What's happening right now?                         | `watasu logs`                       |
| What error did the worker hit during the 3am pager? | Grafana logs                        |
| How often does this exception type appear?          | Grafana logs                        |
| Did this user's request fail, and where?            | Grafana logs (filter by request ID) |

## Make your logs Grafana-friendly

A few habits make a huge difference:

* log structured (JSON) where you can — Grafana indexes labels
* attach request IDs, user IDs, job IDs as labels or fields
* pick a log level discipline (`info` is the floor, `error` for things you'd want paged)
* never log secrets or tokens (Grafana's full-text index makes this especially regrettable)

## What it doesn't do

The logs add-on stores what your app prints. It's not a profiler, an APM, or a tracing tool. For request-level latency analysis, attach [Traces](https://docs.watasu.io/observability/traces.md) too — they correlate with logs in Grafana.

[View this page on the web](https://docs.watasu.io/observability/logs/)
