Skip to content

Commit

Permalink
Remove args from backtrace as it causes issues with monolog
Browse files Browse the repository at this point in the history
  • Loading branch information
camspiers committed Nov 25, 2013
1 parent 3bd7766 commit f5ce3ce
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ public function getBacktrace(\Exception $exception = null)

if ($exception instanceof \Exception) {
$backtrace = $exception->getTrace();
foreach ($backtrace as $index => $backtraceCall) {
unset($backtrace[$index]['args']);
}
} elseif (version_compare(PHP_VERSION, '5.4.0') >= 0) {
$backtrace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS, $this->backtraceLimit);
$skipLimit = true;
Expand Down
20 changes: 10 additions & 10 deletions src/Camspiers/LoggerBridge/LoggerBridge.php
Original file line number Diff line number Diff line change
Expand Up @@ -417,10 +417,10 @@ public function errorHandler($errno, $errstr, $errfile, $errline)
if (in_array($errno, $errorTypes)) {
// Log all errors regardless of type
$context = array(
'errfile' => $errfile,
'errline' => $errline,
'request' => $this->format($this->request),
'model' => $this->format($this->model)
'file' => $errfile,
'line' => $errline,
'request' => $this->format($this->request),
'model' => $this->format($this->model)
);

if ($this->reportBacktrace) {
Expand Down Expand Up @@ -462,10 +462,10 @@ public function errorHandler($errno, $errstr, $errfile, $errline)
public function exceptionHandler(\Exception $exception)
{
$context = array(
'errfile' => $exception->getFile(),
'errline' => $exception->getLine(),
'request' => $this->format($this->request),
'model' => $this->format($this->model)
'file' => $exception->getFile(),
'line' => $exception->getLine(),
'request' => $this->format($this->request),
'model' => $this->format($this->model)
);

if ($this->reportBacktrace) {
Expand Down Expand Up @@ -501,8 +501,8 @@ public function fatalHandler()
}

$context = array(
'errfile' => $error['file'],
'errline' => $error['line']
'file' => $error['file'],
'line' => $error['line']
);

if ($this->reportBacktrace) {
Expand Down

0 comments on commit f5ce3ce

Please sign in to comment.