laravel Artisan 错误记录详细级别

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/33075714/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-14 12:29:18  来源:igfitidea点击:

Artisan error logging verbose level

phplaravelartisanverbose

提问by Terrabythia

I have the following error when I try to run the artisan command php artisan route:list:

当我尝试运行 artisan 命令时出现以下错误php artisan route:list

[Symfony\Component\Debug\Exception\FatalErrorException]  
Call to a member function getAction() on a non-object 

Because I have no idea where this happens, I'm trying to change the artisan verbose level to debug. artisan helptells me this:

因为我不知道这种情况发生在哪里,所以我正在尝试更改 artisan 详细级别以进行调试。artisan help告诉我这个:

--verbose (-v|vv|vvv) Increase the verbosity of messages: 1 for normal output, 2 for more verbose output and 3 for debug

But I have no idea how to use this. I've tried every combination but nothing seems to work. Can anybody tell me how to use the php artisan route:listcommand in debug mode?

但我不知道如何使用它。我已经尝试了所有组合,但似乎没有任何效果。谁能告诉我如何php artisan route:list在调试模式下使用该命令?

回答by Tim

php artisan route:list -vvvshould work. The syntax is as follows: php artisan route:list [options]

php artisan route:list -vvv应该管用。语法如下:php artisan route:list [options]

回答by Viktor

Get current route in a browser will return the currently visited route. In the terminal you do not such a request. Laravel will return null when asking what route is visited. You would have to check for the return value before calling getAction.

在浏览器中获取当前路线将返回当前访问的路线。在终端你没有这样的要求。Laravel 在询问访问的路由时会返回 null。您必须在调用 getAction 之前检查返回值。

Source here.

来源在这里