Have you come to a solution? I'm just facing the same problem.
Jul 2, 2015
3
Level 1
Lumen + papertrail
I've had Laravel integrated with papertrail using https://mattstauffer.co/blog/laravel-forge-logging-with-papertrail for a good while now. All good.
I've come to implement Matt's approach in Lumen and run into an issue. Lumen's Log facade is different to that in Laravel. It is directly linked with Monolog. So there is no Log::getMonolog() method.
I've tried a few approaches to resolving this - but I'm out of ideas. This is my current version (which is still stuffed in routes.php).
Any ideas?
$monolog = new \Monolog\Logger('lumen');
$syslog = new \Monolog\Handler\SyslogHandler('papertrail');
$formatter = new \Monolog\Formatter\LineFormatter(null, null, false, true);
$syslog->setFormatter($formatter);
$monolog->pushHandler($syslog);
var_dump($monolog);
Please or to participate in this conversation.