Skip to content
PHP Ecosystem
Explore

LogTargetFactory

API reference › Debug › service › LogTargetFactory

classyii\debug\service\LogTargetFactory
Sourcesrc/service/LogTargetFactory.php

Resolves the configured log target the module attaches to the application logger during the bootstrap.

PropertyTypeDescriptionDefined by
$module protected readonly constructoryii\debug\ModuleDebug module read for the log-target configuration at call time.LogTargetFactory
MethodDescriptionDefined 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
public function __construct(yii\debug\Module $module)

Binds log-target resolution to the debug module.

Parameters

ParameterTypeDescription
$moduleyii\debug\ModuleDebug module read for the log-target configuration at call time.
public function create(): yii\debug\LogTarget

Resolves 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