PHP code example of wodcz / nette-sentry-bridge

1. Go to this page and download the library: Download wodcz/nette-sentry-bridge library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wodcz / nette-sentry-bridge example snippets



declare(strict_types=1);
igurator;
//$configurator->setDebugMode('23.75.345.200'); // enable for your remote IP
$configurator->enableTracy(__DIR__ . '/../log');
$configurator->setTimeZone('Europe/Prague');
$configurator->setTempDirectory(__DIR__ . '/../temp');
$configurator->createRobotLoader()
	->addDirectory(__DIR__)
	->register();
$configurator->addConfig(__DIR__ . '/config/config.neon');
$configurator->addConfig(__DIR__ . '/config/config.local.neon');

####################################### PART 1 #######################################
# Try to load configuration from app/config/sentry.php file
if(is_array($config = (@


return [
	'dsn' => 'http://key:[email protected]/123',
	'options' => [
		'app_path' => __DIR__.'/../',
		'environment' => 'production',
		'exclude' => [
			'Nette\Application\BadRequestException',
			'Nette\Application\ForbiddenRequestException',
			'Nette\Application\AbortException'
		],
		# 'revision' => '',
		# all options: https://docs.sentry.io/clients/php/config/
	]
];


return [
	'dsn' => getenv('SENTRY_DSN'),
	'options' => [
		'app_path' => __DIR__.'/../',
		'environment' => getenv('DEBUG') === 'true' ? 'development' : 'production',
		'exclude' => [
			'Nette\Application\BadRequestException',
			'Nette\Application\ForbiddenRequestException',
			'Nette\Application\AbortException'
		],
		# 'revision' => '',
		# all options: https://docs.sentry.io/clients/php/config/
	]
];