laravel - 错误日志在 Guzzle http 的 Laravel 中被截断

标签 laravel guzzlehttp

Guzzle http 正在截断超过 120 个字符的异常,但我需要记录完整的异常消息。我怎样才能做到这一点?

我正在使用 Laravel 4.2.22。

最佳答案

Laravel 5 和 4 是一样的

    try {
        $response = $client->post($path, $params);
    } catch (\GuzzleHttp\Exception\RequestException $ex) {
        \Log::debug('error');
        \Log::debug((string) $ex->getResponse()->getBody());
        throw $ex;
    }

如果你只是去 $ex->getMessage() ,你会得到(truncated...)在最后。

关于laravel - 错误日志在 Guzzle http 的 Laravel 中被截断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53862823/

相关文章:

php - laravel eloquent 获取多个用户之间的所有常见聊天

laravel - 在同一系统上从一个 Laravel 应用程序向另一个应用程序进行 Guzzle Http 调用时出现问题

php - cURL 错误 6 : Could not resolve host: test. example.localhost(参见 http ://curl. haxx.se/libcurl/c/libcurl-errors.html)

laravel - 如何为 Laravel 4 路由设置多种模式?

php - 在 Digital Ocean Ubuntu 上设置 Laravel 5.1

php - 如何在使用 laravel 进行 PayPal 付款后插入数据

php - 缓存破坏与 Laravel mix.version() 不工作