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
You can install this bundle using Composer. Since the Sentry SDK uses HTTPlug to remain transport-agnostic, you need to
39
+
manually require two additional packages that provides [`php-http/async-client-implementation`](https://packagist.org/providers/php-http/async-client-implementation)
40
+
and [`http-message-implementation`](https://packagist.org/providers/psr/http-message-implementation).
41
+
42
+
For example, if you want to install/upgrade using Curl as transport and the PSR-7 implementation by Guzzle, you can use:
29
43
30
-
Open a command console, enter your project directory and execute the
31
-
following command to download the latest stable version of this bundle:
This command requires you to have Composer installed globally, as explained
38
-
in the [installation chapter](https://getcomposer.org/doc/00-intro.md)
39
-
of the Composer documentation.
53
+
> TODO: Flex recipe
40
54
41
55
### Step 2: Enable the Bundle
42
56
@@ -52,20 +66,18 @@ class AppKernel extends Kernel
52
66
{
53
67
public function registerBundles()
54
68
{
55
-
$bundles = array(
69
+
$bundles = [
56
70
// ...
57
-
);
71
+
new Sentry\SentryBundle\SentryBundle(),
72
+
];
58
73
59
-
if (in_array($this->getEnvironment(), ['staging', 'prod'], true)) {
60
-
$bundles[] = new Sentry\SentryBundle\SentryBundle();
61
-
}
62
74
// ...
63
75
}
64
76
65
77
// ...
66
78
}
67
79
```
68
-
Note that, with this snippet of code, the bundle will be enabled only for the `staging` and `prod` environment; adjust it to your needs. It's discouraged to enable this bundle in the `test` environment, because the Sentry client will change the error handler, which is already used by other packages like Symfony's deprecation handler (see [#46](https://github.com/getsentry/sentry-symfony/issues/46) and [#95](https://github.com/getsentry/sentry-symfony/issues/95)).
80
+
Note that, unlike before version 3, the bundle will be enabled in all environments.
69
81
70
82
### Step 3: Configure the SDK
71
83
@@ -78,250 +90,24 @@ sentry:
78
90
```
79
91
80
92
## Maintained versions
81
-
* 2.x is actively maintained on the master branch, but it requires Symfony 3+ and PHP 7.1+;
82
-
* 1.x is still supported to allow Symfony 2 and PHP 5.6/7.0; it may receive backports of features from the master branch, but it's not guaranteed
83
-
* 0.8.x is no longer maintained, with the 0.8.8 release containing the latest new features; it may only receive security fixes in the future.
93
+
* 3.x is actively maintained and developed on the master branch, and uses Sentry SDK 2.0;
94
+
* 2.x is supported only for fixes; from this version onwards it requires Symfony 3+ and PHP 7.1+;
95
+
* 1.x is no longer maintained; you can use it for Symfony < 2.8 and PHP 5.6/7.0;
96
+
* 0.8.x is no longer maintained.
84
97
85
98
## Configuration
86
99
87
-
The following options can be configured via ``app/config/config.yml``.
You can change the priority of the 3 default listeners of this bundle with the `listener_priorities` key of your config.
100
-
The default value is `0`, and here are the 3 possible sub-keys:
101
-
102
-
```yaml
103
-
listener_priorities:
104
-
request: 0
105
-
kernel_exception: 0
106
-
console_exception: 0
107
-
```
108
-
109
-
... respectively for the `onKernelRequest`, `onKernelException` and `onConsoleException` events.
110
-
111
-
### Options
112
-
113
-
In the following section you will find some of the available options you can configure, listed alphabetically. All available options and a more detailed description of each can be found [here](https://docs.sentry.io/clients/php/config/), in the Sentry documentation.
114
-
115
-
#### app_path
116
-
117
-
The base path to your application. Used to trim prefixes and mark frames of the stack trace as part of your application.
118
-
119
-
```yaml
120
-
sentry:
121
-
options:
122
-
app_path: "/path/to/myapp"
123
-
```
124
-
125
-
#### environment
126
-
127
-
The environment your code is running in (e.g. production).
128
-
129
-
```yaml
130
-
sentry:
131
-
options:
132
-
environment: "%kernel.environment%"
133
-
```
134
-
135
-
#### error types
136
-
137
-
Define which error types should be reported.
138
-
139
-
```yaml
140
-
sentry:
141
-
options:
142
-
error_types: E_ALL & ~E_DEPRECATED & ~E_NOTICE
143
-
```
144
-
145
-
#### exception_listener
146
-
147
-
This is used to replace the default exception listener that this bundle uses. The value must be a FQCN of a class implementing the SentryExceptionListenerInterface interface. See [Create a Custom ExceptionListener](#create-a-custom-exceptionlistener) for more details.
In previous releases of this bundle, up to 0.8.2, some of the previous options where set outside of the options level of the configuration file. Those still work but are deprecated, and they will be dropped in the stable 1.x release, so **you are advised to abandon them**; to provide forward compatibility, they can still be used alongside the standard syntax, but values must match. This is a list of those options:
190
-
191
-
```yaml
192
-
sentry:
193
-
app_path: ~
194
-
environment: ~
195
-
error_types: ~
196
-
excluded_app_paths: ~
197
-
prefixes: ~
198
-
release: ~
199
-
```
100
+
TODO
200
101
201
102
## Customization
202
103
203
-
It is possible to customize the configuration of the user context, as well as modify the client immediately before an exception is captured by wiring up an event subscriber to the events that are emitted by the default configured `ExceptionListener` (alternatively, you can also just define your own custom exception listener).
204
-
205
-
### Create a custom ExceptionListener
206
-
207
-
You can always replace the default `ExceptionListener` with your own custom listener. To do this, assign a different class to the `exception_listener` property in your Sentry configuration, e.g.:
0 commit comments