Skip to content

Commit 1719c92

Browse files
committed
Updates README.md with instructions on how to configure monolog.
1 parent 0a12cde commit 1719c92

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,30 @@ sentry:
9090
dsn: "https://public:[email protected]/1"
9191
```
9292
93+
#### Optional: use monolog handler provided by `sentry/sentry`
94+
*Note: this step is optional*
95+
96+
If You're using `monolog` for logging e.g. in-app errors, You
97+
can use this handler in order for them to show up in Sentry.
98+
99+
First, define `Sentry\Monolog\Handler` as a service in `app/config/services.yml`
100+
101+
```yaml
102+
services:
103+
sentry.monolog.handler:
104+
class: Sentry\Monolog\Handler
105+
```
106+
107+
Then enable it in `monolog` config:
108+
109+
```yaml
110+
monolog:
111+
sentry:
112+
type: service
113+
id: sentry.monolog.handler
114+
level: error
115+
```
116+
93117
## Maintained versions
94118
* 3.x is actively maintained and developed on the master branch, and uses Sentry SDK 2.0;
95119
* 2.x is supported only for fixes; from this version onwards it requires Symfony 3+ and PHP 7.1+;

0 commit comments

Comments
 (0)