feat: add sentry
This commit is contained in:
parent
a618f27890
commit
2940accc34
4
.env
4
.env
@ -18,3 +18,7 @@
|
||||
APP_ENV=dev
|
||||
APP_SECRET=f27f6cb11fb594fcb5ab4591ec0aac77
|
||||
###< symfony/framework-bundle ###
|
||||
|
||||
###> sentry/sentry-symfony ###
|
||||
SENTRY_DSN=https://ae24268aecd2759193ac7cced34bf543@o4506593513635840.ingest.sentry.io/4506593517830144
|
||||
###< sentry/sentry-symfony ###
|
||||
|
@ -19,6 +19,7 @@
|
||||
"open-telemetry/sdk": "^1.0",
|
||||
"open-telemetry/transport-grpc": "^1.0",
|
||||
"php-http/httplug": "*",
|
||||
"sentry/sentry-symfony": "^4.13",
|
||||
"symfony/asset": "7.0.*",
|
||||
"symfony/asset-mapper": "7.0.*",
|
||||
"symfony/cache": "7.0.*",
|
||||
|
1134
composer.lock
generated
1134
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -6,4 +6,5 @@ return [
|
||||
Twig\Extra\TwigExtraBundle\TwigExtraBundle::class => ['all' => true],
|
||||
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
|
||||
Symfony\Bundle\MonologBundle\MonologBundle::class => ['all' => true],
|
||||
Sentry\SentryBundle\SentryBundle::class => ['prod' => true],
|
||||
];
|
||||
|
26
config/packages/sentry.yaml
Normal file
26
config/packages/sentry.yaml
Normal file
@ -0,0 +1,26 @@
|
||||
when@prod:
|
||||
sentry:
|
||||
dsn: '%env(SENTRY_DSN)%'
|
||||
# this hooks into critical paths of the framework (and vendors) to perform
|
||||
# automatic instrumentation (there might be some performance penalty)
|
||||
# https://docs.sentry.io/platforms/php/guides/symfony/performance/instrumentation/automatic-instrumentation/
|
||||
tracing:
|
||||
enabled: false
|
||||
|
||||
# If you are using Monolog, you also need this additional configuration to log the errors correctly:
|
||||
# https://docs.sentry.io/platforms/php/guides/symfony/#monolog-integration
|
||||
# register_error_listener: false
|
||||
# register_error_handler: false
|
||||
|
||||
# monolog:
|
||||
# handlers:
|
||||
# sentry:
|
||||
# type: sentry
|
||||
# level: !php/const Monolog\Logger::ERROR
|
||||
# hub_id: Sentry\State\HubInterface
|
||||
|
||||
# Uncomment these lines to register a log message processor that resolves PSR-3 placeholders
|
||||
# https://docs.sentry.io/platforms/php/guides/symfony/#monolog-integration
|
||||
# services:
|
||||
# Monolog\Processor\PsrLogMessageProcessor:
|
||||
# tags: { name: monolog.processor, handler: sentry }
|
17
src/Controller/ExceptionController.php
Normal file
17
src/Controller/ExceptionController.php
Normal file
@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Controller;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
use Symfony\Component\Routing\Attribute\Route;
|
||||
|
||||
/**
|
||||
* Used for testing error handling (sentry...)
|
||||
*/
|
||||
class ExceptionController extends AbstractController
|
||||
{
|
||||
#[Route("give-me-error-please/exception")]
|
||||
public function makeException() {
|
||||
throw new \InvalidArgumentException("There is exception");
|
||||
}
|
||||
}
|
12
symfony.lock
12
symfony.lock
@ -49,6 +49,18 @@
|
||||
"tests/bootstrap.php"
|
||||
]
|
||||
},
|
||||
"sentry/sentry-symfony": {
|
||||
"version": "4.13",
|
||||
"recipe": {
|
||||
"repo": "github.com/symfony/recipes-contrib",
|
||||
"branch": "main",
|
||||
"version": "4.6",
|
||||
"ref": "153de5f041f7e8a9c19f3674b800b76be0e6fd90"
|
||||
},
|
||||
"files": [
|
||||
"config/packages/sentry.yaml"
|
||||
]
|
||||
},
|
||||
"symfony/asset-mapper": {
|
||||
"version": "7.0",
|
||||
"recipe": {
|
||||
|
Loading…
Reference in New Issue
Block a user