Commit 578029d
committed
Add English translation
diff --git c/cookbook/en/README.md i/cookbook/en/README.md
index 7d4ad10..6e50ac3 100644
--- c/cookbook/en/README.md
+++ i/cookbook/en/README.md
@@ -12,10 +12,6 @@ This book conforms to the [Terms of Yii Documentation](https://www.yiiframework.
---
-[Preface](preface.md)
-
-## Getting started
-
-## Organizing code
-
+- [Preface](preface.md)
- [Structuring code by use-case with vertical slices](organizing-code/structuring-by-use-case-with-vertical-slices.md)
+- [Sentry integration](sentry-integration.md)
diff --git c/cookbook/en/sentry-integration.md i/cookbook/en/sentry-integration.md
new file mode 100644
index 0000000..67fec61
--- /dev/null
+++ i/cookbook/en/sentry-integration.md
@@ -0,0 +1,117 @@
+# Sentry Integration
+
+## What is Sentry
+
+[Sentry](https://sentry.io/) is a tool for monitoring and debugging application stability and performance.
+Sentry gives you access to the events that you send there from your application.
+
+Most often, Sentry is used for monitoring errors (exceptions).
+You can enrich errors with context to better understand the problem:
+- Request arguments
+- Tags for grouping exceptions
+- Environment state: environment variables, application state, and other global attributes
+
+You can find the full list of features on the official website: https://sentry.io/welcome/
+
+## Installation
+
+### Install the package
+
+Install the required package `yiisoft/yii-sentry` with the following command:
+
+```shell
+composer require yiisoft/yii-sentry --prefer-dist
+```
+
+### Install an HTTP driver
+
+The [`getsentry/sentry-php`](https://github.com/getsentry/sentry-php) library requires the `php-http/httplug` package and any HTTP driver.
+In the example below we’ll use the Guzzle adapter.
+
+> You can find the list of all adapters on [this page](https://docs.php-http.org/en/latest/clients.html#clients-adapters).
+
+To install the packages, run the following command:
+
+```shell
+composer require php-http/httplug php-http/guzzle7-adapter --prefer-dist
+```
+
+## Configuration
+
+### Get and store the token
+
+Next, configure the application.
+
+First, register at [Sentry](https://sentry.io) and create a project.
+
+Then, in the project settings on the “General Settings” tab, find the “Security Token” field and copy its value.
+
+Now put this token into the package configuration. By default, the config is located at `config/packages/yiisoft/yii-sentry/config/params.php`.
+Set the copied token as the value of the array element at `yiisoft/yii-sentry` => `options` => `dsn`. Example:
+
+```diff
+'yiisoft/yii-sentry' => [
+ 'enabled' => true,
+ 'options' => [
+- 'dsn' => '',
++ 'dsn' => 'TOKEN',
+ ],
+],
+```
+
+### Configure the HTTP client
+
+After installing the HTTP client, configure it.
+
+Create the file `config/common/sentry.php` and put the following code into it:
+
+```php
+<?php
+
+declare(strict_types=1);
+
+return [
+ \Http\Client\HttpClient::class => \GuzzleHttp\Client::class,
+ \Http\Client\HttpAsyncClient::class => [
+ 'class' => \Http\Adapter\Guzzle7\Client::class,
+ '__construct()' => [
+ \Yiisoft\Factory\Definition\Reference::to(\Http\Client\HttpClient::class),
+ ],
+ ],
+];
+```
+
+# Integration
+
+### Web
+
+Sentry support for `web` is implemented as middleware.
+
+That means you only need to add `SentryMiddleware` to the global middleware list in `config/web/application.php`:
+
+```diff
+return [
+ Yiisoft\Yii\Web\Application::class => [
+ '__construct()' => [
+ 'dispatcher' => DynamicReference::to(static function (Injector $injector) {
+ return ($injector->make(MiddlewareDispatcher::class))
+ ->withMiddlewares(
+ [
+ Router::class,
+ SubFolder::class,
++ SentryMiddleware::class,
+ ErrorCatcher::class,
+ ]
+ );
+ }),
+ 'fallbackHandler' => Reference::to(NotFoundHandler::class),
+ ],
+ ],
+];
+```
+
+### Console
+
+Sentry supports `console` via a handler for the [ConsoleEvents::ERROR](https://symfony.com/doc/current/components/console/events.html#the-consoleevents-error-event) event.
+
+The package provides a configuration file that automatically subscribes the application to this event.
diff --git c/cookbook/ru/README.md i/cookbook/ru/README.md
index 87d1f5b..1a24a7d 100644
--- c/cookbook/ru/README.md
+++ i/cookbook/ru/README.md
@@ -9,8 +9,5 @@
---
-Оглавление
----------------
-
[Вступление](preface.md)
[Интеграция с Sentry](sentry-integration.md)1 parent ab4e22f commit 578029d
3 files changed
+119
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
| 15 | + | |
21 | 16 | | |
| 17 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
13 | | - | |
14 | | - | |
15 | 12 | | |
16 | 13 | | |
0 commit comments