orisai/nette-monolog

Monolog logger integration for Nette

1.5.0 2024-07-09 08:04 UTC

This package is auto-updated.

Last update: 2024-11-27 14:36:57 UTC


README

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

}