Skip to content

Commit 560ba4e

Browse files
authored
Merge pull request #34 from buggregator/feature/25
Updates docs
2 parents 606807e + ce5bb0a commit 560ba4e

File tree

4 files changed

+208
-31
lines changed

4 files changed

+208
-31
lines changed

docs/config/inspector.md

Lines changed: 49 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Integration — Inspector
22

3-
Buggregator is also compatible with Inspector reports, providing you with a lightweight alternative for local
3+
Buggregator is compatible with Inspector reports, providing you with a lightweight alternative for local
44
development. With it, you can easily configure your Inspector client URL to send data directly to the server, making it
55
easier to identify and fix issues during the development phase.
66

@@ -38,3 +38,51 @@ most popular languages.
3838

3939
> **Note:**
4040
> You can find out documentation on [official site](https://docs.inspector.dev/)
41+
42+
## Secret key validation
43+
44+
Buggregator lets you send reports freely by default, but you can boost your security by setting up a secret key.
45+
46+
In our example, we will use `my-secret-key` as the secret key. Let's see how to set it up.
47+
48+
### Server configuration
49+
50+
To use a secret key, set the `INSPECTOR_SECRET_KEY` environment variable on your server.
51+
52+
**Here’s how to do it:**
53+
54+
```bash
55+
docker run --pull always \
56+
-p ... \
57+
-e INSPECTOR_SECRET_KEY=my-secret-key \
58+
ghcr.io/buggregator/server:latest
59+
```
60+
61+
> **Note:** Read more about server configuration [here](../getting-started.md).
62+
63+
When you set the secret key, the server checks the `X-Inspector-Key` header to make sure it matches the secret key.
64+
65+
### Client configuration
66+
67+
To set the secret key on a client, change your DSN like this:
68+
69+
**Laravel**
70+
71+
```dotenv
72+
INSPECTOR_INGESTION_KEY=my-secret-key
73+
```
74+
75+
**Other platforms**
76+
77+
```php
78+
use Inspector\Inspector;
79+
use Inspector\Configuration;
80+
81+
$configuration = new Configuration('my-secret-key');
82+
$configuration->setUrl('http://[email protected]:8000');
83+
$inspector = new Inspector($configuration);
84+
85+
// ...
86+
```
87+
88+
> **Note:** Read more about ingestion key configuration on [official site](https://docs.inspector.dev/)

docs/config/ray.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
# Integration — Spatie Ray
22

3-
Buggregator is compatible with `spatie/ray` package. The Ray debug tool supports PHP, Ruby, JavaScript, TypeScript,
4-
NodeJS, Go and Bash applications. After installing one of the libraries, you can use the ray function to quickly dump
5-
stuff. Any variable(s) that you pass will be sent to the Buggregator.
3+
[Ray](https://myray.app/) is a debug tool that was created by Spatie. It is a great alternative to the Symfony
4+
VarDumper component especially for Laravel applications. Buggregator is compatible with the Ray, and it's a good free
5+
alternative for debugging your applications.
6+
7+
> **Note:** Some of the features of Ray are not available in Buggregator, like colors, sizes, and other visual features.
68
79
![ray](https://github.com/buggregator/server/assets/773481/168b27f7-75b1-4837-b0a1-37146d5b8b52)
810

9-
**Supported features**: Simple data, Labels, Caller, Trace, Counter, Class name of an object, Measure, Json, Xml,
10-
Carbon, File, Table, Image, Html, Text, Notifications, Phpinfo, Exception, Show queries, Count queries, Show events,
11-
Show jobs, Show cache, Model, Show views, Markdown, Collections, Env, Response, Request, Application log, Show Http
12-
client requests
11+
Ray provides packages for PHP, Ruby, JavaScript, TypeScript, NodeJS, Go, and Bash applications. So using it you can
12+
dump variables in many languages straight to the Buggregator.
1313

1414
## Laravel
1515

@@ -28,9 +28,9 @@ [email protected] # Ray server host (Current HTTP buggregator port)
2828
RAY_PORT=8000 # Ray server port
2929
```
3030

31-
## Framework agnostic PHP
31+
## Framework-agnostic PHP
3232

33-
In framework agnostic projects you can use this template as the ray config file.
33+
In framework-agnostic projects you can use this template as the ray config file.
3434

3535
```php
3636
<?php
@@ -69,5 +69,13 @@ return [
6969
];
7070
```
7171

72-
You can find out more information about installation and configuration
73-
on [official site](https://spatie.be/docs/ray/v1/introduction)
72+
## Other languages
73+
74+
- [JavaScript](https://myray.app/docs/javascript/vanilla-javascript/getting-started)
75+
- [Bash](hhttps://myray.app/docs/other-languages/bash/installation)
76+
- [Go](https://myray.app/docs/other-languages/go/getting-started)
77+
- [Ruby](https://myray.app/docs/other-languages/ruby/getting-started)
78+
79+
---
80+
81+
That's it! Now you can use the `ray()` function as usual. The output will be sent to the remote server.

docs/config/sentry.md

Lines changed: 105 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
11
# Integration — Sentry exceptions
22

3-
Buggregator offers seamless integration with Sentry reports, making it a reliable tool for local development. With
4-
it, you can easily configure your Sentry DSN to send data directly to the server, providing you with a lightweight
5-
alternative for debugging your application.
3+
Buggregator integrates seamlessly with Sentry reports, making it ideal for local development. You can easily configure
4+
your app to send data to the Buggregator server, offering a lightweight alternative for debugging without any limits
5+
or registration. Send exceptions as many times as you need, without any restrictions.
66

77
![sentry](https://github.com/buggregator/server/assets/773481/e979fda5-54c8-42cc-8224-a1c5d828569a)
88

9-
By using Buggregator to receive Sentry reports, you can identify and fix issues with your application before deploying
10-
it to production. This ensures that your application is robust and efficient, providing a smooth experience for your
11-
users. So, if you're looking for an easy and efficient way to receive Sentry reports during local development,
12-
Buggregator is the perfect tool for you.
9+
Using Buggregator with Sentry helps you identify and fix issues before production, ensuring a smooth user experience.
10+
For easy and efficient Sentry report handling during development, choose Buggregator.
11+
12+
> **Note:** For local debugging, Buggregator is an excellent tool, but Sentry is the recommended solution for full-scale
13+
> production needs.
1314
1415
## What is Sentry?
1516

@@ -50,7 +51,8 @@ SENTRY_DSN=http://[email protected]:8000/1
5051

5152
### Installation
5253

53-
Magento 2 is supported via the following package, you can read more about it [here](https://github.com/justbetter/magento2-sentry)
54+
Magento 2 is supported via the following package, you can read more about
55+
it [here](https://github.com/justbetter/magento2-sentry)
5456

5557
### Configuration
5658

@@ -70,8 +72,72 @@ or
7072
...
7173
]
7274
```
75+
7376
in the `app/etc/env.php`
7477

78+
## WordPress
79+
80+
### Installation and configuration
81+
82+
> Make sure `WP_ENVIRONMENT_TYPE`is set to `local`. [Local](https://localwp.com/) (by WPEngine) does that by default.
83+
84+
1. Install [WP Sentry](https://wordpress.org/plugins/wp-sentry-integration/). You don't have to activate it. We
85+
will [load it early](https://github.com/stayallive/wp-sentry/tree/v7.13.0?tab=readme-ov-file#loading-sentry-before-wordpress),
86+
to catch errors early.
87+
88+
2. In `wp-config.php` add:
89+
90+
```php
91+
// NOTE: WP_ENVIRONMENT_TYPE must be defined and set to 'local'.
92+
if (defined('WP_ENVIRONMENT_TYPE') && 'local' === WP_ENVIRONMENT_TYPE) {
93+
define( 'WP_SENTRY_PHP_DSN', 'http://[email protected]:8000/1' );
94+
define( 'WP_SENTRY_ERROR_TYPES', E_ALL & ~E_NOTICE & ~E_USER_NOTICE );
95+
require_once __DIR__ . '/wp-content/plugins/wp-sentry-integration/wp-sentry.php';
96+
}
97+
```
98+
99+
## JavaScript
100+
101+
Buggregator provides an HTTP endpoint `/sentry/<project>.js` to include in your project. It's a fast and easy way to
102+
start using Buggregator with your JavaScript application.
103+
104+
Read more about the [Sentry JavaScript SDK](https://docs.sentry.io/platforms/javascript/#install)
105+
106+
In order to get started using the Sentry JavaScript SDK, add the following code to the top of your application, before
107+
all other scripts:
108+
109+
```html
110+
111+
<script src="http://127.0.0.1:8000/sentry/1.js"></script>
112+
```
113+
114+
This script will load the Sentry SDK and configure it to send errors to the Buggregator.
115+
116+
### Configuration
117+
118+
Before you can use it, you need to configure server ENV variables. By default, Buggregator uses the following ENV
119+
variables:
120+
121+
```dotenv
122+
# Sentry SDK URL (Actual version can be found here https://docs.sentry.io/platforms/javascript/install/loader/#cdn)
123+
SENTRY_JS_SDK_URL=https://browser.sentry-cdn.com/7.69.0/bundle.tracing.replay.min.js
124+
125+
# Sentry DSN host that will be used in the SDK
126+
SENTRY_JS_DSN_HOST=http://[email protected]:8000
127+
```
128+
129+
You can override them by setting the following ENV variables:
130+
131+
```bash
132+
docker run --pull always \
133+
-p ... \
134+
-e SENTRY_JS_DSN_HOST=http://[email protected]:8000 \
135+
-e SENTRY_JS_SDK_URL=https://browser.sentry-cdn.com/7.69.0/bundle.tracing.replay.min.js \
136+
ghcr.io/buggregator/server:latest
137+
```
138+
139+
> **Note:** Read more about server configuration [here](../getting-started.md).
140+
75141
## Other platforms
76142

77143
To report to Buggregator you’ll need to use a language-specific SDK. The Sentry team builds and maintains these for most
@@ -82,3 +148,34 @@ After you have installed the SDK, you can configure Sentry DSN to report to Bugg
82148
```dotenv
83149
SENTRY_DSN=http://[email protected]:8000/1
84150
```
151+
152+
## Secret key validation
153+
154+
Buggregator lets you send exceptions freely by default, but you can boost your security by setting up a secret key.
155+
156+
In our example, we will use `my-secret-key` as the secret key. Let's see how to set it up.
157+
158+
### Server configuration
159+
160+
To use a secret key, set the `SENTRY_SECRET_KEY` environment variable on your server.
161+
162+
**Here’s how to do it:**
163+
164+
```bash
165+
docker run --pull always \
166+
-p ... \
167+
-e SENTRY_SECRET_KEY=my-secret-key \
168+
ghcr.io/buggregator/server:latest
169+
```
170+
171+
> **Note:** Read more about server configuration [here](../getting-started.md).
172+
173+
When you set the secret key, the server checks the `X-Sentry-Auth` header to make sure it matches the secret key.
174+
175+
### Client configuration
176+
177+
To set the secret key on a client, change your DSN like this:
178+
179+
```dotenv
180+
SENTRY_DSN=http://my-secret-key:[email protected]:8000/1
181+
```

docs/config/var-dumper.md

Lines changed: 35 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,16 @@
11
# Integration — Symfony VarDumper server
22

3-
Buggregator is fully compatible with
4-
the [Symfony VarDumper](https://symfony.com/doc/current/components/var_dumper.html#the-dump-server) component. This is a
5-
big deal for PHP developers because it makes debugging a lot smoother and more intuitive.
3+
The Symfony VarDumper tool is essential for debugging PHP applications. It helps inspect and understand PHP variables
4+
clearly. Normally, `dump()` and `dd()` functions show their output in the browser or console.
65

7-
![var-dumper](https://github.com/buggregator/server/assets/773481/b77fa867-0a8e-431a-9126-f69959dc18f4)
8-
9-
## What is Symfony VarDumper?
6+
A great feature of VarDumper is redirecting debug outputs to a remote server. Using Buggregator as the remote server,
7+
you can receive all debug outputs from your application, making debugging smoother and more intuitive for PHP
8+
developers.
109

11-
1. **Essential Debugging Tool:** Symfony VarDumper is a powerful tool for debugging PHP applications. It helps you
12-
inspect and understand PHP variables in a more readable format.
10+
For more details, check
11+
the [official documentation](https://symfony.com/doc/current/components/var_dumper.html#the-dump-server).
1312

14-
2. **Default Behavior:** By default, the `dump()` and `dd()` functions output their contents in the same browser window
15-
or console terminal as your own application. This can be confusing at times, as it mixes the real output with the
16-
debug output.
13+
![var-dumper](https://github.com/buggregator/server/assets/773481/b77fa867-0a8e-431a-9126-f69959dc18f4)
1714

1815
## Installation
1916

@@ -44,3 +41,30 @@ or via PHP if there is no `.env` file in your project:
4441
$_SERVER['VAR_DUMPER_FORMAT'] = 'server';
4542
$_SERVER['VAR_DUMPER_SERVER'] = '127.0.0.1:9912';
4643
```
44+
45+
That's it! Now you can use the `dump()` and `dd()` functions as usual. The output will be sent to the remote server.
46+
47+
## Browser performance
48+
49+
VarDumper send data to the server in HTML format. So if you dump an object with a lot of properties and nested objects,
50+
it can significantly slow down the browser. To partially solve this issue, you can use `VAR_DUMPER_PREVIEW_MAX_DEPTH`
51+
env variable to limit the depth of the preview on the events list page.
52+
53+
All you need to do is add environment variable to a command that starts Buggerator server:
54+
55+
```bash
56+
docker run --pull always \
57+
-p ... \
58+
-e VAR_DUMPER_PREVIEW_MAX_DEPTH=3 \
59+
ghcr.io/buggregator/server:latest
60+
```
61+
62+
> **Note:** Read more about server configuration [here](../getting-started.md).
63+
64+
And the server will show only 3 levels of nested objects in the preview, but you can still see the full dump by opening
65+
the event page.
66+
67+
## Trap
68+
69+
Please consider to use [Buggregator Trap](../trap/what-is-trap.md) to dump variables in your application. It uses
70+
the Symfony VarDumper component under the hood, but it's more powerful and has additional features.

0 commit comments

Comments
 (0)