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
This example shows how to integrate BugSnag with Symfony 6. Full instructions on how to set BugSnag up with Symfony can be found in [the official BugSnag documentation](https://docs.bugsnag.com/platforms/php/symfony/).
4
+
Symfony 6.4 requires PHP 8.1.0 or higher. Alternatively, you can run this using Docker.
5
+
6
+
## Using Docker
7
+
8
+
This example comes with a `Dockerfile` you can use to run the project.
9
+
Please first build the image:
10
+
11
+
```shell
12
+
docker build -t bugsnag-symfony6 .
13
+
```
14
+
15
+
Then run the container:
16
+
17
+
```shell
18
+
docker run -it --rm -p 8000:8000 bugsnag-symfony6
19
+
```
20
+
21
+
You can then access the application at [http://localhost:8000](http://localhost:8000).
22
+
23
+
## Manual installation
24
+
25
+
1. Install composer, following the instructions provided in the [composer documentation](http://getcomposer.org/doc/01-basic-usage.md)
26
+
27
+
2. Install dependencies using composer
28
+
29
+
```shell
30
+
composer install
31
+
```
32
+
33
+
### Running the example
34
+
35
+
To run the example:
36
+
37
+
```shell
38
+
symfony server:start
39
+
```
40
+
41
+
Or for the command example:
42
+
43
+
```shell
44
+
php bin/console app:crash
45
+
```
46
+
47
+
## Configuring BugSnag
48
+
49
+
There are two ways of configuring your BugSnag client.
50
+
51
+
1. Set the configuration options in`config/packages/bugsnag.yaml`. These values will automatically be loaded in when the application starts.
52
+
53
+
```yaml
54
+
bugsnag:
55
+
api_key: 'YOUR_API_KEY'
56
+
auto_notify: true
57
+
```
58
+
59
+
2. Use environment variables. In this example you can set the `BUGSNAG_API_KEY` environment variable to your api key. This can also be setin the applications `.env` file:
60
+
61
+
```env
62
+
BUGSNAG_API_KEY=YOUR_API_KEY_HERE
63
+
```
64
+
65
+
More information about configuring BugSnag can be found in [the configuration section of the BugSnag documentation](https://docs.bugsnag.com/platforms/php/symfony/configuration-options/).
66
+
67
+
In Symfony 6 the BugSnag bundle should be automatically registered in the `config/bundles.php` file:
0 commit comments