---
title: "Monolog"
description: "Learn how to use Monolog with Sentry's Symfony SDK."
url: https://docs.sentry.io/platforms/php/guides/symfony/integrations/monolog/
---

# Monolog | Sentry for Symfony

Monolog logs can be captured as [Sentry Logs](https://docs.sentry.io/platforms/php/guides/symfony/logs.md) for better searchability and querying.

To enable this, set `enable_logs` to `true` in your Sentry configuration:

`config/packages/sentry.yaml`

```yaml
sentry:
  options:
    enable_logs: true
```

Then configure the Monolog handler for logs:

`config/packages/monolog.yaml`

```yaml
services:
  Sentry\SentryBundle\Monolog\LogsHandler:
    arguments:
      - !php/const Monolog\Logger::WARNING

monolog:
  handlers:
    sentry_logs:
      type: service
      id: Sentry\SentryBundle\Monolog\LogsHandler
```

You can control which log levels are sent to Sentry Logs by configuring the handler's minimum level in your services configuration.

## [Breadcrumbs](https://docs.sentry.io/platforms/php/guides/symfony/integrations/monolog.md#breadcrumbs)

When using [Monolog](https://github.com/Seldaek/monolog) you can configure a [breadcrumb](https://docs.sentry.io/platforms/php/guides/symfony/enriching-events/breadcrumbs.md) handler to capture Monolog messages as breadcrumbs. The breadcrumb handler does not send anything to Sentry directly. It records breadcrumbs that are attached to a later event or exception.

`config/services.yaml`

```yaml
services:
  Sentry\Monolog\BreadcrumbHandler:
    arguments:
      $hub: '@Sentry\State\HubInterface'
      $level: !php/const Monolog\Logger::INFO
```
