# Structured Logging Connected to Errors and Traces

> Send structured logs to Sentry and see them alongside your errors, traces, and issues. Search, filter, and aggregate with full context to debug faster

**URL:** https://sentry.io/product/logs/

---

Structured logging turns log lines into queryable events with real metadata, not raw strings. Sentry keeps those logs next to your errors and traces, so you can see what happened and why without switching tools.

## Features

### Logs connected to your issues

See the logs behind a failed cron job, dropped webhook, or bad deploy—right from the issue.

View logs alongside stack traces, releases, and traces—like seeing job_type:"refresh_tokens" right next to the exception 

Understand what happened before and after an error—like the status:500 response from a third-party API that preceded a crash

### Trace-connected logs for faster debugging

Sentry connects structured logs to [traces](https://sentry.io/product/tracing/), so you can spot retry loops, fallback logic, or silent failures that don’t throw exceptions.

View logs inline with spans—like seeing retry=true or response_time:3000 right where the delay occurred 

Understand slowness across services by following logs tied to span_id, trace_id, or custom fields

### Structured logging that makes search easy

Structured logs in Sentry make it easy to search by real metadata—not just raw strings.

Attach properties like customer_id or payment_id to your log messages

Filter and search logs with queries like customer_id:"cus_123" or payment_id:"pay_456" to zero in on specific issues 

Group logs by fields like payment_id to surface repeat failures tied to the same transaction

Trigger alerts based on structured values—like a spike in errors for a single customer

## Features

- **Livestream logs**: See new logs as they arrive.

- **Log-Based Alerts**: Get notified on patterns or anomalies

- **Log Dashboards**: Visualize key trends and fields

- **Structured logs**: Sentry’s structured logging lets you pass variables directly in string templates—we’ll extract both the template and its values so you can filter, group, and debug with real context, not just raw strings. — [Learn more](https://docs.sentry.io/platforms/javascript/logs/#usage)

- **Log aggregation**: A 500 error appears in Sentry. With log aggregation, you can view related logs—like timeouts or bad inputs—alongside the error to quickly find the cause.

## FAQ

**What is structured logging?**

Structured logging records each log as an event with named fields instead of a plain string. Rather than writing a sentence into a log line, you attach properties like customer_id or payment_id to the message. That makes logs searchable and groupable, so you can filter to a single customer or transaction instead of grepping raw text. In Sentry you can pass variables directly in string templates and we extract both the template and its values.

**How much do logs cost?**

Sentry Logs is currently available for all users. You get 5GB of logs for free and are $0.50/GB after that. Learn more in [docs](https://docs.sentry.io/pricing/#logs-pricing).

**Why Logs in Sentry?**

When debugging, logs, traces, and [errors](https://sentry.io/product/error-monitoring/) work better together. Logs provide the granular context—like retries, API failures, and internal state—that spans and errors can miss. But in most tools today, logs live in a separate system, forcing you to switch between tools to piece together the full picture.

With logs in Sentry, everything is in one place. You can see logs right alongside your errors and traces—no more context switching, just faster debugging.

**How to get started?**

Getting started is just as easy as adding a `console.log`or `logger.info`. Our SDKs handle the heavy lifting, automatically linking your logs to traces and errors so you get the full context with minimal setup.

Check out our docs to [read more.](https://docs.sentry.io/product/logs/getting-started/)

## Of course we have more logging content

- [Errors, traces, logs, metrics: when to reach for what](https://blog.sentry.io/errors-traces-logs-metrics-when-to-reach-for-what/): Errors, traces, logs, and metrics overlap more than you'd think. An opinionated, practical guide to which signal to reach for, and why the choice decides what you (and your coding agents) can debug later.

- [How to structure a log](https://blog.sentry.io/structure-a-log/): Good logs are not just messages. They are small, queryable events with stable names, scalar attributes, and enough context to debug production systems.

- [When and what should I be logging?](https://blog.sentry.io/logging-best-practices/): When in doubt, start by adding a few targeted log lines. Here are best practices for using logs to make your application easier to debug.

- [Sentry vs Logging](/vs/logging/): Learn more about how Sentry has differentiated itself from logging.

- [Logging in Python: A Developer’s Guide](https://blog.sentry.io/logging-in-python-a-developers-guide/#python-logging-best-practices): Learn more about logging in Python with Sentry.

## Testimonials

> Log -> trace -> reply in @getsentry is quite magical, glad logging is finally supported there

> — Greg Kedzierski, Tailplane

> I think @getsentry has become my all-in-one observability solution. It even has logs now—LFG!

> — @arjunz, @techulus

> I love it! This is fantastic! It's super simple and not bloated with unecessary features. It's already helped me solve multiple bugs without needing to SSH in my server.

> — V.T., 

> ALREADY LOVING LOGS!! Finally we will be able to fully migrate to Sentry!

> — A.S.A, 

---

*Source: [sentry.io/product/logs/](https://sentry.io/product/logs/)*
