Created
April 3, 2017 12:16
-
-
Save jrdnrc/148d7d088583bd5c26e692b50e73b8da to your computer and use it in GitHub Desktop.
Paper trail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php declare(strict_types=1); | |
namespace App\Laravel\Providers; | |
use Illuminate\Support\ServiceProvider; | |
/** | |
* Class PaperTrailServiceProvider | |
* @package App\Laravel\Providers | |
* @author jrdn | |
*/ | |
final class PaperTrailServiceProvider extends ServiceProvider | |
{ | |
/** | |
* | |
*/ | |
public function register() | |
{ | |
$logger = app('log')->getMonolog(); | |
$syslog = new \Monolog\Handler\SyslogUdpHandler(config('services.papertrail.host'), config('services.papertrail.port')); | |
$formatter = new \Monolog\Formatter\LineFormatter('%level_name%: %message%'); | |
$syslog->setFormatter($formatter); | |
$logger->pushHandler($syslog); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment