PHP code example of nackjicholson / monolog-symfony2-console
1. Go to this page and download the library: Download nackjicholson/monolog-symfony2-console 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/ */
nackjicholson / monolog-symfony2-console example snippets
$output = new \Symfony\Component\Console\Output\ConsoleOutput();
$consoleFormatter = new \Nack\Monolog\Formatter\Symfony2ConsoleFormatter();
$consoleHandler = new \Nack\Monolog\Handler\Symfony2ConsoleHandler($output);
$consoleHandler->setFormatter($consoleFormatter);
$logger = new \Monolog\Logger('channel');
$logger->pushHandler($consoleHandler);
$logger->debug('Debug Life');
$logger->info('Just a little FYI');
$logger->notice('A little something to see here');
$logger->warning('Pay attention, be careful');
$logger->error('Your program broke, it happens');
$logger->critical('Oh my goodness, someone do something!');
$logger->emergency('It is all on fire! You may be fired!');