找到你要的答案

Q:How to check if Laravel command is still running?

Q:如何检查,如果Laravel命令正在运行?

I've searched around and I cannot find the answer.

So, is there a way to check if the custom Laravel command that we have started still running, or it has finished it's job?

我四处搜寻,我找不到答案。

那么,有没有办法检查自定义命令,我们已经开始laravel仍然运行,或已完成的工作?

answer1: 回答1:

You can always log information into the log files when running certain commands that you wish to confirm ran or not.

You can place the log code directly inside your command's handle method.

    public function handle()
    {
        // Handle some command logic...

        Log::info('This is some useful information about the command that just ran its course.');
    }

在运行某些要确认的命令时,可以始终将信息记录到日志文件中。

可以将日志代码直接放置在命令的句柄方法中。

    public function handle()
    {
        // Handle some command logic...

        Log::info('This is some useful information about the command that just ran its course.');
    }
php  laravel  laravel-4  artisan