我想使用Log
来记录,它在控制器中工作,但它在应用程序中不起作用(vendor / laravel / framework / src / Illuminate / Foundation / Application.php)
这是我的代码:
<?php
namespace Illuminate\Foundation;
use Log;
use Closure;
use RuntimeException;
use Illuminate\Support\Arr;
use Illuminate\Support\Str;
use Illuminate\Http\Request;
use Illuminate\Container\Container;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\ServiceProvider;
use Illuminate\Events\EventServiceProvider;
use Illuminate\Routing\RoutingServiceProvider;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Illuminate\Contracts\Foundation\Application as ApplicationContract;
class Application extends Container implements ApplicationContract, HttpKernelInterface
{
public function make($abstract, array $parameters = [])
{
$abstract = $this->getAlias($abstract);
if (isset($this->deferredServices[$abstract])) {
$this->loadDeferredProvider($abstract);
}
Log::info('test info '); // 698 line
return parent::make($abstract, $parameters);
}
当我向工匠发球时,我发现错误:
php artisan serve
Fatal error: Class 'Log' not found in vendor/laravel/framework/src/Illuminate/Foundation/Application. php on line 698