The package provides an easy connection between Tracy and Sentry.
It's best to use Composer for installation, and you can also find the package on Packagist and GitHub.
To install, simply use the command:
$ composer require baraja-core/tracy-sentry-bridge
You can use the package manually by creating an instance of the internal classes, or register a DIC extension to link the services directly to the Nette Framework.
In your project Bootstrap:
public static function boot(): Configurator
{
$configurator = new Configurator;
if (\function_exists('\Sentry\init')) {
\Sentry\init(
[
'dsn' => 'https://....',
'attach_stacktrace' => true,
]
);
}
// register here:
SentryLogger::register();
}
The tool automatically loads the original Tracy Logger and registers logging to Sentry. Logging takes place to the Sentry and at the same time to the original log, which does not interrupt the integrity of the data.
If the log write to the Sentry fails, the exception is written to the original Logger.
baraja-core/tracy-sentry-bridge
is licensed under the MIT license. See the LICENSE file for more details.