Created
August 11, 2019 14:27
-
-
Save gvgvgvijayan/adf649288da082fa735a1b77689fdc88 to your computer and use it in GitHub Desktop.
Tombstone helper
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 | |
namespace Helper\TombstoneHelper; | |
use Scheb\Tombstone\{ | |
GraveyardProvider, | |
Handler\StreamHandler, | |
Tracing\TraceProvider | |
}; | |
class TombstoneHelper { | |
public $logPath = "/var/www/html/tombstone/logs/tombstones.log"; | |
public function __construct() { | |
$streamHandler = new StreamHandler($this->logPath); | |
GraveyardProvider::getGraveyard()->addHandler($streamHandler); | |
} | |
public function tombstone() { | |
try { | |
$trace = TraceProvider::getTraceHere(); | |
GraveyardProvider::getGraveyard() | |
->tombstone(func_get_args(), $trace, []); | |
} catch (\Exception $ex) { | |
//Log your exception | |
var_dump($ex); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment