如果我在Silex中定义monolog日志记录:
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\FirePHPHandler;
$app = new Silex\Application();
$app->register(new Silex\Provider\MonologServiceProvider(), array(
'monolog.name' => 'logger',
'monolog.logfile' => $logdir . '/f2alma.log',
'monolog.level' => \Monolog\Logger::DEBUG
));
$app['monolog']->addDebug('Testing the Monolog logging.');
...
$app->run();
我收到错误的PHP消息:
[Wed Jan 06 10:07:34.994088 2016] [:error] [pid 4594] [客户 130.133.152.188:47369] PHP Catchable致命错误:参数4传递给 Symfony的\分量\ HttpKernel \事件监听\ RouterListener :: __结构() 必须是Psr \ Log \ LoggerInterface的实例,实例 Monolog \ Logger给出,调用 /usr/local/silex/vendor/silex/silex/src/Silex/Application.php上线 102并定义于 /usr/local/silex/vendor/symfony/http-kernel/EventListener/RouterListener.php 在第52行
这里有什么问题?
谢谢,
了Christoph