<?php $params = array_merge(require __DIR__ . '/../../common/config/params.php', require __DIR__ . '/../../common/config/params-local.php', require __DIR__ . '/params.php', require __DIR__ . '/params-local.php'); return ['id' => 'app-practical-a-frontend', 'basePath' => dirname(__DIR__), 'bootstrap' => ['log'], 'controllerNamespace' => 'frontend\\controllers', 'components' => ['log' => ['traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => [['class' => \yii\log\FileTarget::className(), 'levels' => ['error']]]], 'errorHandler' => ['errorAction' => 'site/error']], 'params' => $params];
} if (!isset($base['components']['view'])) { $base['components']['view'] = ['class' => View::className()]; } if (!isset($base['components']['response'])) { $base['components']['response'] = ['class' => Response::className()]; } if (!isset($base['components']['log'])) { $base['components']['log'] = []; } if (!isset($base['components']['log']['flushInterval'])) { $base['components']['log']['flushInterval'] = 1; } if (!isset($base['components']['log']['traceLevel'])) { $base['components']['log']['traceLevel'] = YII_DEBUG ? 3 : 0; } if (!isset($base['components']['log']['targets'])) { $base['components']['log']['targets'] = []; } $base['components']['log']['targets'][] = ['class' => FileTarget::className(), 'levels' => ['error', 'warning']]; $base['components']['log']['targets'][] = ['class' => FileTarget::className(), 'categories' => ['yii\\swiftmailer\\Logger::add'], 'logFile' => "@runtime/logs/mail.log", 'exportInterval' => 1]; if (!isset($base['components']['formatter'])) { $base['components']['formatter'] = ['class' => I18nFormatter::className(), 'dateFormat' => 'MM/dd/yyyy']; } if (YII_DEBUG) { if (!isset($base['components']['errorHandler'])) { $base['components']['errorHandler'] = []; } $base['components']['errorHandler']['discardExistingOutput'] = false; } return $base;
$base['components']['user'] = ['class' => 'canis\\web\\User', 'enableAutoLogin' => false, 'identityClass' => 'cascade\\server\\models\\User', 'loginUrl' => ['/user/login']]; } if (!isset($base['components']['fileStorage'])) { $base['components']['fileStorage'] = ['class' => FileStorage::className()]; } if (!isset($base['components']['view'])) { $base['components']['view'] = ['class' => View::className()]; } if (!isset($base['components']['response'])) { $base['components']['response'] = ['class' => Response::className()]; } if (!isset($base['components']['log'])) { $base['components']['log'] = []; } if (!isset($base['components']['log']['traceLevel'])) { $base['components']['log']['traceLevel'] = YII_DEBUG ? 3 : 0; } if (!isset($base['components']['log']['targets'])) { $base['components']['log']['targets'] = []; $base['components']['log']['targets'][] = ['class' => FileTarget::className(), 'levels' => ['error', 'warning']]; } if (!isset($base['components']['formatter'])) { $base['components']['formatter'] = ['class' => I18nFormatter::className(), 'dateFormat' => 'MM/dd/yyyy']; } if (YII_DEBUG) { if (!isset($base['components']['errorHandler'])) { $base['components']['errorHandler'] = []; } $base['components']['errorHandler']['discardExistingOutput'] = false; } return $base;
/** * Creates a file log target, if it is required. * @return FileTarget|null file log target or null, if it is not required. */ protected function createFileLogTarget() { if (empty($this->logFile)) { return null; } return Yii::createObject(['class' => FileTarget::className(), 'exportInterval' => 1, 'categories' => [get_class($this) . '*'], 'logFile' => $this->logFile]); }