Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/279.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 到控制台的Laravel异常输出_Php_Exception_Laravel 5.4 - Fatal编程技术网

Php 到控制台的Laravel异常输出

Php 到控制台的Laravel异常输出,php,exception,laravel-5.4,Php,Exception,Laravel 5.4,我的Laravel设置有一个问题,每当我调用artisan命令抛出异常时,在执行catch块中的任何内容之前,when is catch显示为输出 这会导致很容易产生千兆字节的日志文件和/或极慢的执行,因为它必须将千兆字节的文本写入控制台 它过去工作得很好,自从上次工作以来,我没有做过任何重大的更新 设置: PHP7.1 拉威尔5.4 通用输出的一部分: removed (1/1) February removed (1/1) February removed (1/1) February re

我的Laravel设置有一个问题,每当我调用artisan命令抛出异常时,在执行catch块中的任何内容之前,when is catch显示为输出

这会导致很容易产生千兆字节的日志文件和/或极慢的执行,因为它必须将千兆字节的文本写入控制台

它过去工作得很好,自从上次工作以来,我没有做过任何重大的更新

设置: PHP7.1 拉威尔5.4

通用输出的一部分:

removed
(1/1) February
removed
(1/1) February
removed
(1/1) February
removed
(1/1) February
removed
(1/1) February
object(ErrorException)#4587 (8) {
  ["message":protected]=>
  string(40) "Creating default object from empty value"
  ["string":"Exception":private]=>
  string(0) ""
  ["code":protected]=>
  int(0)
  ["file":protected]=>
  string(69) "/home/kim/www_reports/app/Console/Commands/removed.php"
  ["line":protected]=>
  int(107)
  ["trace":"Exception":private]=>
  array(23) {
    [0]=>
    array(6) {
      ["file"]=>
      string(69) "/home/kim/www_reports/app/Console/Commands/removed.php"
      ["line"]=>
      int(107)
      ["function"]=>
      string(11) "handleError"
      ["class"]=>
      string(48) "Illuminate\Foundation\Bootstrap\HandleExceptions"
      ["type"]=>
      string(2) "->"
      ["args"]=>
      array(5) {
        [0]=>
        int(2)
        [1]=>
        string(40) "Creating default object from empty value"
        [2]=>
        string(69) "/home/kim/www_reports/app/Console/Commands/removed.php"
        [3]=>
        int(107)
        [4]=>
        array(17) {
          ["customerId"]=>
          string(10) "removed"
          ["year"]=>
我完全了解错误本身,但它肯定是一个问题,每次捕获异常对象时,它都会坚持输出几十行或几十万行异常对象的var_转储

欢迎提出任何建议

真诚地, 罗尼

[更新]

回到家后,我启动了一个SSH,然后再次尝试。
问题不再存在,不知道为什么、什么或如何…

不要转储异常。而是获取相关信息。看看,但是你可以使用像
$exception->getMessage()
$exception->getLine()
,等等这样的方法。问题是,我现在不会在手机上转储异常,我回家后会添加我的try-catch块