PHP code example of sitmpcz / sentry-logger

1. Go to this page and download the library: Download sitmpcz/sentry-logger 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/ */

    

sitmpcz / sentry-logger example snippets


/** @var \Sitmpcz\SentryLogger @inject */
public \Sitmpcz\SentryLogger $sentryLogger;

$this->sentryLogger->log(new \Exception("test sentry"),\Tracy\ILogger::ERROR);

\Tracy\Debugger::log("Test zapistu do logu",\Tracy\ILogger::CRITICAL);

private ?object $sentryPerformance = null;

function startup(): void
{
   parent::startup();
   $this->sentryPerformance = Sitmpcz\SentryPerformance::startPerformaceMonitoring($this->getName(), $this->getAction());
}

function shutdown(Nette\Application\Response $response): void
{
   parent::shutdown($response);
   if ($this->sentryPerformance) Sitmpcz\SentryPerformance::endPerformaceMonitoring($this->sentryPerformance);
}