PHP code example of noerdisch / elasticlog
1. Go to this page and download the library: Download noerdisch/elasticlog 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/ */
noerdisch / elasticlog example snippets
use Neos\Flow\Annotations as Flow;
use Noerdisch\ElasticLog\Log\ImportLoggerInterface;
class SomeClass
{
/**
* @Flow\Inject
* @var ImportLoggerInterface
*/
protected $logger;
public function yourMethod()
{
try {
$this->callSomeMethod();
} catch (Exception $exception) {
$this->logger->logThrowable($exception, ['identifier' => 'foo']);
}
}
}