phpvms/app/Console/Logger.php

24 lines
408 B
PHP
Raw Normal View History

<?php
namespace App\Console;
use Monolog\Handler\StreamHandler;
/**
* Just a simple custom logger that dumps to the console
*/
class Logger
{
public function __invoke(array $config)
{
$logger = new \Monolog\Logger('console');
2018-08-27 00:40:04 +08:00
try {
$logger->pushHandler(new StreamHandler('php://stdout'));
} catch (\Exception $e) {
}
return $logger;
}
}