• Модуль: main
  • Путь к файлу: ~/bitrix/modules/main/lib/diag/logformatter.php
  • Класс: BitrixMainDiagLogFormatter
  • Вызов: LogFormatter::formatException
protected function formatException(Throwable $exception): string
{
	$result = '[' . get_class($exception) . '] ';

	if ($exception instanceof ErrorException)
	{
		$result .= static::severityToString($exception->getSeverity());
	}

	$result .= "n" . $exception->getMessage() . ' (' . $exception->getCode() . ')' . "n";

	if ($exception instanceof DBSqlQueryException)
	{
		$result .= $exception->getQuery() . "n";
	}

	$file = $exception->getFile();
	if ($file)
	{
		$result .= $file . ':' . $exception->getLine() . "n";
	}

	return $result;
}