Add a failure-coloured message to the log.
@param string $message
@param \Exception $exception The exception that caused the error.
14296
public function logFailure($message, \Exception $exception = null)
    {
        $context = array();

        // The psr3 log interface stipulates that exceptions should be passed
        // as the exception key in the context array.
        if ($exception) {
            $context['exception'] = $exception;
        }

        $this->log(
            "\033[0;31m" . $message . "\033[0m",
            LogLevel::ERROR,
            $context
        );
    }
615633
private function eventMsg(\Exception $exception)
    {
        return sprintf('%s (%s line:%s)', $exception->getMessage(), $exception->getFile(), $exception->getLine());
    }
909255
private function logException($message, $exception)
    {
        return $this->app['logger.system']->error(
            $message . ': ' . $exception->getMessage(),
            ['event' => 'exception', 'exception' => $exception]
        );
    }
200084
protected function logException(\Exception $exception)
    {
        if (!$exception instanceof \OxidEsales\Eshop\Core\Exception\StandardException) {
            $exception = new \OxidEsales\Eshop\Core\Exception\StandardException($exception->getMessage(), $exception->getCode(), $exception);
        }
        \OxidEsales\Eshop\Core\Registry::getLogger()->error($exception->getMessage(), [$exception]);
    }
628796
protected function logException( \Exception $e )
	{
		$logger = $this->context->getLogger();

		$logger->log( $e->getMessage(), \Aimeos\MW\Logger\Base::WARN, 'client/html' );
		$logger->log( $e->getTraceAsString(), \Aimeos\MW\Logger\Base::WARN, 'client/html' );
	}
887692
public void info(final String message, final Exception exception) {
        messages.add(new LogMessage(message + " " + exception.getMessage(), LogMessage.Type.INFO));
        log.info(message, exception);
    }
1243716
private function handleException(\Throwable $exception, Message $message, array $options)
    {
        $this->client->captureException($exception, $this->buildSentryData($message, $options));

        throw $exception;
    }
54780
public function assertIsEmpty($value, $message='%s must not be empty', $exception='Asserts')
    {
        if (isset($value) === false || empty($value)) {
            $this->throwException($exception, $message, $value);
        }
    }
1247108
public function catchException($exception)
    {
        if (in_array(get_class($exception), $this->config->getExcludeExceptions())) {
            return;
        }

        try {
            $this->send(
                Formatter::make($exception, $this->config)->toArray()
            );
        } catch (Exception $exception) {
            error_log('AfterBug Error: Couldn\'t notify. '.$exception->getMessage());
        }
    }
1284461
public function logException($level, $message, array $context = [], $exception = null)
    {
        $this->log($level, $message, array_merge($context, ['exception'=>$exception]));
    }
201461
public function validInternalServerErrorJsonResponse($exception, $message = 'Error')
    {
        return response()->json(
            [
                'exception' => class_basename($exception),
                'file' => basename($exception->getFile()),
                'line' => $exception->getLine(),
                'message' => $exception->getMessage(),
                'trace' => $exception->getTrace(),
            ], 500, [], JSON_PRETTY_PRINT
        );
    }
192346
public static function addResourceError(ResourceInterface $resource, $message, \Exception $e = null): void
    {
        $resource->setStatus(ResourceStatutes::ERROR);
        $resource->getErrors()->add(new ConstraintViolation($message, $message, [], $resource->getRealData(), null, null, null, null, null, $e));
    }
1276555
public function logErrorException(\Exception $e)
    {
        if ($this->getServerContext()->hasLogger(LoggerUtils::SYSTEM)) {
            $this->getServerContext()->getLogger(LoggerUtils::SYSTEM)->error($e->__toString());
        }
    }
1207570
protected function handleException(\Exception $exception)
    {
        $this->response->setStatus(500);
        // may be we want also an exceptionHandler e.g. to notify somebody, ...
        $this->addFlashMessage(
            $exception->getMessage(),
            get_class($exception),
            Message::SEVERITY_ERROR,
            [],
            $exception->getCode()
        );
    }
38685
public function logException(\Exception $exception, $prefix = "Exception thrown")
    {
        $class = new \ReflectionClass($exception);
        $this->logger->critical("$prefix [{$class->getName()}] {$exception->getMessage()} on line {$exception->getLine()} of {$exception->getFile()}\n");
        $this->logger->debug("Debug trace for exception: {$exception->getTraceAsString()}");
    }
602546
protected function writeException(\Exception $exception, array $record = array())
    {
        $record = array_merge($this->defautlRecord, $record);
        $this->output->writeln($this->formatter->formatException($exception, $record));
    }
959828
function logexception(\Exception $exception) {
		try {
			$message = $exception->getMessage();
			$trace = $exception->getTraceAsString();
			$trace = $this->becloud($trace);
			$trace = str_replace("\n", "\n\t", trim($trace, " \n\r\t"));
			$this->log("$message\n\n\t$trace\n");
		}
		catch (\Exception $e) {
			$this->failedLogging($e, $exception->getMessage());
		}
	}