Skip to content

Commit 370af7b

Browse files
committed
Fills all docs sections
1 parent ce0f756 commit 370af7b

File tree

15 files changed

+640
-185
lines changed

15 files changed

+640
-185
lines changed

docs/.vitepress/config.mts

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,38 +8,47 @@ export default defineConfig({
88
themeConfig: {
99
// https://vitepress.dev/reference/default-theme-config
1010
nav: [
11-
{text: 'Home', link: '/'},
12-
{text: 'Docs', link: '/intro'}
11+
{text: 'Docs', link: '/'},
1312
],
1413

1514
sidebar: [
1615
{
17-
text: 'Introduction',
16+
text: 'What is Buggregator?',
17+
link: '/',
18+
},
19+
{
20+
text: 'Getting Started',
21+
link: '/getting-started',
22+
},
23+
{
24+
text: 'Contributing',
1825
items: [
1926
{
20-
text: 'What is Buggregator?',
21-
link: '/intro',
27+
text: 'Architecture',
28+
link: '/contributing/architecture',
2229
},
2330
{
24-
text: 'Getting Started',
25-
link: '/getting-started',
31+
text: 'Server',
32+
link: '/contributing/server',
2633
},
2734
{
28-
text: 'Contributing',
29-
link: '/contributing',
35+
text: 'Frontend',
36+
link: '/contributing/frontend',
3037
},
3138
]
3239
},
3340

3441
{
3542
text: 'Configuration',
3643
items: [
37-
{text: 'Sentry', link: '/config/sentry'},
38-
{text: 'VarDumper', link: '/config/var-dumper'},
3944
{text: 'XHProf', link: '/config/xhprof'},
40-
{text: 'Monolog', link: '/config/monolog'},
45+
{text: 'VarDumper', link: '/config/var-dumper'},
4146
{text: 'Ray', link: '/config/ray'},
47+
{text: 'Sentry', link: '/config/sentry'},
48+
{text: 'SMTP server', link: '/config/smtp'},
49+
{text: 'Monolog', link: '/config/monolog'},
4250
{text: 'Inspector', link: '/config/inspector'},
51+
{text: 'Http Dumps', link: '/config/http-dumps'},
4352
]
4453
}
4554
],

docs/config/http-dumps.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Configuration — HTTP dumps
2+
3+
It's an indispensable tool that simplifies the process of capturing, analyzing, and debugging HTTP requests in their
4+
applications. With the HTTP Requests Dump Server, developers can effortlessly capture all the relevant request data and
5+
gain valuable insights. They can dive deep into the captured requests, examine their contents, and pinpoint any issues
6+
or anomalies that might be affecting their application's performance.
7+
8+
Simply start the server and send your requests to the `http://[email protected]:8000` URL, it will not only
9+
capture the URI segments but also gather additional details such as the request `headers`, `cookies`, `POST data`,
10+
`query strings`, and any `uploaded files`.
11+
12+
For instance, let's say you have a POST request: `http://[email protected]:8000/user/3/update`. In this case,
13+
server will intercept the request and capture all the relevant information. It will then display the
14+
dumped data, allowing you to examine the request details, including the URI segments (`user/3/update` in this example).
15+
16+
![HTTP Requests dump server](https://github.com/spiral/docs/assets/773481/209f9c8c-00d2-4086-9f54-ce2cf8121394)

docs/config/inspector.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Configuration — Inspector
2+
3+
Buggregator is also compatible with Inspector reports, providing you with a lightweight alternative for local
4+
development. With it, you can easily configure your Inspector client URL to send data directly to the server, making it
5+
easier to identify and fix issues during the development phase.
6+
7+
![inspector](https://user-images.githubusercontent.com/773481/208734651-e8dca2bf-6674-4aed-b6fc-601bc877f7ce.png)
8+
9+
## Laravel
10+
11+
Laravel is supported via a native package. You can read about integrations
12+
on [official site](https://docs.inspector.dev/laravel)
13+
14+
```php
15+
INSPECTOR_URL=http://[email protected]:8000
16+
INSPECTOR_API_KEY=test
17+
INSPECTOR_INGESTION_KEY=1test
18+
INSPECTOR_ENABLE=true
19+
```
20+
21+
## Other platforms
22+
23+
For PHP you can use `inspector-apm/inspector-php` package.
24+
25+
```php
26+
use Inspector\Inspector;
27+
use Inspector\Configuration;
28+
29+
$configuration = new Configuration('YOUR_INGESTION_KEY');
30+
$configuration->setUrl('http://[email protected]:8000');
31+
$inspector = new Inspector($configuration);
32+
33+
// ...
34+
```
35+
36+
To report to Buggregator you’ll need to use a language-specific SDK. The Inspector team builds and maintains these for
37+
most popular languages.
38+
39+
> **Note:**
40+
> You can find out documentation on [official site](https://docs.inspector.dev/)

docs/config/monolog.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
# Configuration — Monolog
2+
3+
Buggregator comes with a powerful Monolog server that can receive logs from the popular `monolog/monolog` package via
4+
the `\Monolog\Handler\SocketHandler` handler. With this feature, you can easily track and analyze the logs generated by
5+
your PHP application, making it easier to identify issues and improve its overall performance.
6+
7+
By using Buggregator's Monolog server, you can gain valuable insights into your application's behavior and improve its
8+
overall efficiency. So, whether you're a seasoned developer or just starting, the Monolog server in Buggregator is a
9+
must-have tool for anyone serious about PHP development.
10+
11+
![monolog](https://user-images.githubusercontent.com/773481/208729325-b135870e-3a98-4841-90cb-6e507108a235.png)
12+
13+
## Spiral Framework
14+
15+
You can register socket handler for monolog via bootloader.
16+
17+
**Bootloader example**
18+
19+
```php
20+
<?php
21+
22+
declare(strict_types=1);
23+
24+
namespace App\Bootloader;
25+
26+
use Monolog\Formatter\JsonFormatter;
27+
use Monolog\Handler\SocketHandler;
28+
use Spiral\Boot\Bootloader\Bootloader;
29+
use Spiral\Boot\EnvironmentInterface;
30+
use Spiral\Monolog\Bootloader\MonologBootloader;
31+
32+
class LoggingBootloader extends Bootloader
33+
{
34+
public function init(MonologBootloader $monolog, EnvironmentInterface $env): void
35+
{
36+
$handler = new SocketHandler($env->get('MONOLOG_SOCKET_HOST'), chunkSize: 10);
37+
$handler->setFormatter(new JsonFormatter(JsonFormatter::BATCH_MODE_NEWLINES));
38+
$monolog->addHandler('socket', $handler);
39+
}
40+
}
41+
```
42+
43+
**Env variables**
44+
45+
```dotenv
46+
MONOLOG_DEFAULT_CHANNEL=socket
47+
MONOLOG_SOCKET_HOST=127.0.0.1:9913
48+
```
49+
50+
## Laravel
51+
52+
```php
53+
// config/logging.php
54+
return [
55+
// ...
56+
'channels' => [
57+
// ...
58+
'socket' => [
59+
'driver' => 'monolog',
60+
'level' => env('LOG_LEVEL', 'debug'),
61+
'handler' => \Monolog\Handler\SocketHandler::class,
62+
'formatter' => \Monolog\Formatter\JsonFormatter::class,
63+
'handler_with' => [
64+
'connectionString' => env('LOG_SOCKET_URL', '127.0.0.1:9913'),
65+
],
66+
],
67+
],
68+
];
69+
```
70+
71+
### Configuration
72+
73+
```dotenv
74+
LOG_CHANNEL=socket
75+
LOG_SOCKET_URL=127.0.0.1:9913
76+
```
77+
78+
## Other PHP frameworks
79+
80+
Install monolog
81+
82+
```bash
83+
composer require monolog/monolog
84+
```
85+
86+
```php
87+
<?php
88+
89+
use Monolog\Logger;
90+
use Monolog\Handler\SocketHandler;
91+
use Monolog\Formatter\JsonFormatter;
92+
93+
// create a log channel
94+
$log = new Logger('buggregator');
95+
$handler = new SocketHandler('127.0.0.1:9913');
96+
$handler->setFormatter(new JsonFormatter());
97+
$log->pushHandler($handler);
98+
99+
// Send records to the Buggregator
100+
$log->warning('Foo');
101+
$log->error('Bar');
102+
```

docs/config/ray.md

Lines changed: 73 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
# Configuration — Spatie Ray
2+
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.
6+
7+
![Ray debug tool](https://github.com/buggregator/spiral-app/assets/773481/c2a84d40-fc99-4bde-b87f-ea81cc1daa17)
8+
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
13+
14+
## Laravel
15+
16+
Please make sure `ray.php` config published to the project root.
17+
18+
You can run an artisan command to publish it in to the project root.
19+
20+
```bash
21+
php artisan ray:publish-config
22+
```
23+
24+
**Env variables**
25+
26+
```
27+
[email protected] # Ray server host (Current HTTP buggregator port)
28+
RAY_PORT=8000 # Ray server port
29+
```
30+
31+
## Framework agnostic PHP
32+
33+
In framework agnostic projects you can use this template as the ray config file.
34+
35+
```php
36+
<?php
37+
// Save this in a file called "ray.php"
38+
39+
return [
40+
/*
41+
* This settings controls whether data should be sent to Ray.
42+
*/
43+
'enable' => true,
44+
45+
/*
46+
* The host used to communicate with the Ray app.
47+
*/
48+
'host' => '[email protected]',
49+
50+
/*
51+
* The port number used to communicate with the Ray app.
52+
*/
53+
'port' => 8000,
54+
55+
/*
56+
* Absolute base path for your sites or projects in Homestead, Vagrant, Docker, or another remote development server.
57+
*/
58+
'remote_path' => null,
59+
60+
/*
61+
* Absolute base path for your sites or projects on your local computer where your IDE or code editor is running on.
62+
*/
63+
'local_path' => null,
64+
65+
/*
66+
* When this setting is enabled, the package will not try to format values sent to Ray.
67+
*/
68+
'always_send_raw_values' => false,
69+
];
70+
```
71+
72+
You can find out more information about installation and configuration
73+
on [official site](https://spatie.be/docs/ray/v1/introduction)

docs/config/sentry.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# Configuration — Sentry exceptions
2+
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.
6+
7+
![sentry](https://user-images.githubusercontent.com/773481/208728578-1b33174b-8d1f-411a-a6fe-180a89abf06f.png)
8+
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.
13+
14+
## What is Sentry?
15+
16+
[Sentry](https://sentry.io/) is an error tracking tool that helps developers monitor and fix crashes in real-time. It's
17+
a powerful tool for understanding what's happening with your applications in production.
18+
19+
## Laravel
20+
21+
### Installation
22+
23+
Laravel is supported via a native package. You can read about integrations
24+
on [official site](https://docs.sentry.io/platforms/php/guides/laravel/)
25+
26+
### Configuration
27+
28+
All you need to do is set the `SENTRY_LARAVEL_DSN` environment variable in your `.env` file:
29+
30+
```dotenv
31+
SENTRY_LARAVEL_DSN=http://[email protected]:8000/1
32+
```
33+
34+
## Spiral Framework
35+
36+
### Installation
37+
38+
Spiral Framework is supported via a native package. You can read about integrations
39+
on [official site](https://spiral.dev/docs/extension-sentry/3.3/en)
40+
41+
### Configuration
42+
43+
All you need to do is set the `SENTRY_LARAVEL_DSN` environment variable in your `.env` file:
44+
45+
```dotenv
46+
SENTRY_DSN=http://[email protected]:8000/1
47+
```
48+
49+
## Other platforms
50+
51+
To report to Buggregator you’ll need to use a language-specific SDK. The Sentry team builds and maintains these for most
52+
popular languages. You can find out documentation on [official site](https://docs.sentry.io/platforms/)
53+
54+
After you have installed the SDK, you can configure Sentry DSN to report to Buggregator:
55+
56+
```dotenv
57+
SENTRY_DSN=http://[email protected]:8000/1
58+
```

docs/config/smtp.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Configuration — Fake SMTP server
2+
3+
Buggregator is more than just a PHP debugging tool. It also includes a powerful email testing feature that allows you to
4+
install and configure a local email server with ease.
5+
6+
For example, you can configure a local WordPress site to use Buggregator's SMTP server for email deliveries. This makes
7+
it effortless to test email functionality during the development phase, ensuring that everything works as expected
8+
before deployment. So, if you're looking for a reliable and easy-to-use email testing tool, Buggregator's fake SMTP
9+
server is the way to go.
10+
11+
![smtp](https://user-images.githubusercontent.com/773481/208727862-229fda5f-3504-4377-921e-03f0ff602cb9.png)
12+
13+
## Spiral Framework
14+
15+
```dotenv
16+
MAILER_DSN=smtp://127.0.0.1:1025
17+
```
18+
19+
## Laravel
20+
21+
```dotenv
22+
MAIL_MAILER=smtp
23+
MAIL_HOST=127.0.0.1
24+
MAIL_PORT=1025
25+
```

0 commit comments

Comments
 (0)