Skip to content

nackjicholson/monolog-symfony2-console

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

monolog-symfony2-console

Monolog for Symfony2 Console Component output.

Why? Because StreamHandler to php://stdout is ugly, and Symfony2 Console Output is pretty.

But...you really shouldn't use this because symfony/MonologBridge is better.

Install

"require": {
    "nackjicholson/monolog-symfony2-console": "0.0.2"
}

composer require nackjicholson/monolog-symfony2-console:0.0.x

Basic Usage:

$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!');

example

About

Monolog Handler for Symfony2 Console Component output.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages