を上書きYii2:ここは、私がこのように私のconfigsをマージ、ネストされた設定パラメータ
$config = \yii\helpers\ArrayHelper::merge(
(require (__DIR__ . '/../config/web.php')),
(require __DIR__ . '/../config/overrides/web.php')
);
がのconfig/web.phpある
$config = [
'components' => [
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
],
[
'class' => 'yii\log\EmailTarget',
'levels' => ['info'],
'categories' => ['parsingFailure'],
'logVars' => [],
'message' => [
'from' => ['[email protected]'],
'to' => ['[email protected]'],
'subject' => 'Message parsing failure',
],
],
],
],
//....some more components
]
];
ここで私はを適用しようオーバーライドですconfig/overrides/web.php
$config = [
'components' => [
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [],
],
]
];
私の目標は、ローカル設定でのロギングを無効にすることです。 の動作がarray_mergeと異なるため、何も上書きされないため、もちろん動作しません。
これは完璧に動作します! –