Monolog logger integration for Nette
📄 Check out our documentation.
💸 If you like Orisai, please make a donation. Thank you!
use Psr\Log\LoggerInterface;
final class ImportantCode
{
private LoggerInterface $logger;
public function __construct(LoggerInterface $logger)
{
$this->logger = $logger;
}
public function doSomethingImportant(): void
{
try {
// Dark magic
$this->logger->info('Everything is fine!');
} catch (WeHaveAProblemHouston $e) {
$this->logger->critical('Dumpster fire!', [
'exception' => $e,
]);
}
}
}