Created
August 25, 2020 23:32
-
-
Save Gimcrack/3a6cbf5ec78768229bedbbd28cd75a74 to your computer and use it in GitHub Desktop.
Papertrail Log Formatter
This file contains hidden or 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 | |
namespace App\Exceptions; | |
use Monolog\Formatter\LineFormatter; | |
class PapertrailFormatter extends LineFormatter { | |
public const SIMPLE_FORMAT = "%channel%.%level_name%: %message% %context% %extra%\n"; | |
public function includeStacktraces(bool $include = true) | |
{ | |
$this->includeStacktraces = false; | |
} | |
public function allowInlineLineBreaks(bool $allow = true) | |
{ | |
$this->allowInlineLineBreaks = true; | |
} | |
public function format(array $record): string | |
{ | |
return "[" . config('app.name') . "]." . parent::format($record); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment