门面模式 Laravel Log::info () 是如何运行的
我用的是laravel 5.2 对应的是 Writer
namespace Illuminate\Log;
class Writer implements LogContract, PsrLoggerInterface
{
public function info($message, array $context = [])
{
return $this->writeLog(__FUNCTION__, $message, $context);
}
}
请问Log::info() 调用的时候,他是怎么绑定到Write这个类的,我在config/app.php下没有看到相关的配置,只看到有个别名
'aliases' => [
'Log' => Illuminate\Support\Facades\Log::class,
]
namespace Illuminate\Support\Facades;
/**
* @see \Illuminate\Log\Writer
*/
class Log extends Facade
{
/**
* Get the registered name of the component
* @return string
*/
protected static function getFacadeAccessor()
{
return 'log';
}
}
https://github.com/laravel/framework/blob/...
额,,,怎么找到的吗,,,因为之前看过一本书,介绍
Laravel
的,,,大概知道这些基础服务,是在应用启动时,注册到容器中的,,,然后顺着代码,,找了一下,,public/index.php
->bootstrap/app.php
->App\Http\Kernel
->$bootstrappers
->ConfigureLogging
Laravel 请求生命周期小结
文章里看下,【用请求生成响应】小节,,,