You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: "Learn how to enable Sentry's Symfony SDK to capture Monolog events."
4
+
---
5
+
6
+
When using [Monolog](https://github.com/Seldaek/monolog) you can configure a [breadcrumb](../../enriching-events/breadcrumbs/) handler to capture Monolog messages as breadcrumbs and a handler that captures messages as events in Sentry.
7
+
The breadcrumb handler will not send anything to Sentry directly, it only records breadcrumbs that will be attached to any event or exception sent to Sentry.
8
+
9
+
```yaml
10
+
services:
11
+
# Configure the breadcrumb handler as a service
12
+
Sentry\Monolog\BreadcrumbHandler:
13
+
arguments:
14
+
- '@Sentry\State\HubInterface'
15
+
- !php/constMonolog\Logger::INFO # Configures the level of messages to capture as breadcrumbs
16
+
17
+
monolog:
18
+
handlers:
19
+
# Register the breadcrumb handler as a Monolog handler
20
+
sentry_breadcrumbs:
21
+
type: service
22
+
name: sentry_breadcrumbs
23
+
id: Sentry\Monolog\BreadcrumbHandler
24
+
# Register the handler as a Monolog handler to capture messages as events
25
+
sentry:
26
+
type: sentry
27
+
level: !php/const Monolog\Logger::ERROR # Configures the level of messages to capture as events
0 commit comments