Skip to content

Monolog logger integration for Nette

License

Notifications You must be signed in to change notification settings

orisai/nette-monolog

Repository files navigation

Orisai
Nette Monolog

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,
			]);
		}
	}

}