composer require weew/app-monolog
This package integrates the monolog/monolog library into the weew/php-app package.
To make monolog available inside the application, simply register MonologProvider
on the kernel.
$app->getKernel()->addProviders([
MonologProvider::class
]);
You can retrieve a specific logger by the channel name:
$channelManager = $app->getContainer()->get(IMonologChannelManager::class);
$channelManager->getLogger('config_name');
This is how your configuration might look like:
monolog:
channels:
default:
log_file_path: /var/logs/default.log
log_level: debug
error:
log_file_path: /var/logs/error.log
log_level: debug