LogTargetFactory
API reference › Debug › service › LogTargetFactory
Resolves the configured log target the module attaches to the application logger during the bootstrap.
Properties
Section titled “Properties”| Property | Type | Description | Defined by |
|---|---|---|---|
$module protected readonly constructor | yii\ | Debug module read for the log-target configuration at call time. | LogTargetFactory |
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
__construct() | Binds log-target resolution to the debug module. | LogTargetFactory |
create() | Resolves Module::$logTarget into a LogTarget instance, accepting a class-name string, a configuration array with a class key, or an already-instantiated target. | LogTargetFactory |
Method details
Section titled “Method details”__construct()
Section titled “__construct() ”public function __construct(yii\debug\Module $module)Binds log-target resolution to the debug module.
Parameters
| Parameter | Type | Description |
|---|---|---|
$module | yii\ | Debug module read for the log-target configuration at call time. |
create()
Section titled “create() ”public function create(): yii\debug\LogTargetResolves Module::$logTarget into a LogTarget instance, accepting a class-name string, a
configuration array with a class key, or an already-instantiated target.
The module itself is handed to the target as the first constructor argument, so a custom target reaches the panels and the storage it captures into.
Returns
yii\debug\LogTarget: Target built from the configured class name, array, or instance.
Throws
yii\base\InvalidConfigException: when the configured class is missing or does not produce aLogTarget.