Created
March 12, 2014 20:30
-
-
Save peterfox/9515686 to your computer and use it in GitHub Desktop.
This is a simple piece of code that can be added to Laravel's global.php file to start logging to Logentries.
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
/* | |
|-------------------------------------------------------------------------- | |
| LogEntries Error Logger | |
|-------------------------------------------------------------------------- | |
| | |
| This adds a handler to Monolog which will send logging data to the cloud service | |
| log entries. Make sure there is a logentries.php in your config folder with | |
| an array key defined as 'token'. The format of the messages will be the same | |
| minus the time and date as the service itself will record that. | |
| | |
*/ | |
$handler = new \Logentries\Handler\LogentriesHandler(Config::get('logentries.token')); | |
$handler->setFormatter(new Monolog\Formatter\LineFormatter("%channel%.%level_name%: %message% %context% %extra%\n")); | |
Log::getMonolog()->pushHandler($handler); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment