I
I
Ilya Beloborodov2017-07-06 14:03:07
Yii
Ilya Beloborodov, 2017-07-06 14:03:07

Do not log Stack trace?

Is it possible somehow to disable the Stack trace recording?
I, for example, do not need this in app.log

#0 C:\xampp\htdocs\localhost\vendor\yiisoft\yii2\di\Container.php(424): ReflectionClass->__construct('yii\\web\\JqueryA...')
#1 C:\xampp\htdocs\localhost\vendor\yiisoft\yii2\di\Container.php(364): yii\di\Container->getDependencies('yii\\web\\JqueryA...')
#2 C:\xampp\htdocs\localhost\vendor\yiisoft\yii2\di\Container.php(156): yii\di\Container->build('yii\\web\\JqueryA...', Array, Array)
#3 C:\xampp\htdocs\localhost\vendor\yiisoft\yii2\BaseYii.php(344): yii\di\Container->get('yii\\web\\JqueryA...', Array, Array)
#4 C:\xampp\htdocs\localhost\vendor\yiisoft\yii2\web\AssetManager.php(266): yii\BaseYii::createObject(Array)
#5 C:\xampp\htdocs\localhost\vendor\yiisoft\yii2\web\AssetManager.php(239): yii\web\AssetManager->loadBundle('yii\\web\\JqueryA...', Array, true)
#6 C:\xampp\htdocs\localhost\vendor\yiisoft\yii2\web\View.php(286): yii\web\AssetManager->getBundle('yii\\web\\JqueryA...')
#7 C:\xampp\htdocs\localhost\vendor\yiisoft\yii2\web\View.php(291): yii\web\View->registerAssetBundle('yii\\web\\JqueryA...', NULL)
#8 C:\xampp\htdocs\localhost\vendor\yiisoft\yii2\web\AssetBundle.php(125): yii\web\View->registerAssetBundle('frontend\\assets...')
#9 C:\xampp\htdocs\localhost\frontend\views\layouts\main.php(20): yii\web\AssetBundle::register(Object(yii\web\View))
#10 C:\xampp\htdocs\localhost\vendor\yiisoft\yii2\base\View.php(328): require('C:\\xampp\\htdocs...')
#11 C:\xampp\htdocs\localhost\vendor\yiisoft\yii2\base\View.php(250): yii\base\View->renderPhpFile('C:\\xampp\\htdocs...', Array)
#12 C:\xampp\htdocs\localhost\vendor\yiisoft\yii2\base\Controller.php(396): yii\base\View->renderFile('C:\\xampp\\htdocs...', Array, Object(frontend\controllers\SiteController))
#13 C:\xampp\htdocs\localhost\vendor\yiisoft\yii2\base\Controller.php(382): yii\base\Controller->renderContent('<main class="pa...')
#14 C:\xampp\htdocs\localhost\frontend\controllers\SiteController.php(113): yii\base\Controller->render('index', Array)
#15 [internal function]: frontend\controllers\SiteController->actionIndex()
#16 C:\xampp\htdocs\localhost\vendor\yiisoft\yii2\base\InlineAction.php(57): call_user_func_array(Array, Array)
#17 C:\xampp\htdocs\localhost\vendor\yiisoft\yii2\base\Controller.php(156): yii\base\InlineAction->runWithParams(Array)
#18 C:\xampp\htdocs\localhost\vendor\yiisoft\yii2\base\Module.php(523): yii\base\Controller->runAction('index', Array)
#19 C:\xampp\htdocs\localhost\vendor\yiisoft\yii2\web\Application.php(102): yii\base\Module->runAction('site/index', Array)
#20 C:\xampp\htdocs\localhost\vendor\yiisoft\yii2\base\Application.php(380): yii\web\Application->handleRequest(Object(common\components\LangRequest))
#21 C:\xampp\htdocs\localhost\frontend\web\index.php(35): yii\base\Application->run()
#22 {main}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Timofeev, 2017-07-06
@webinar

www.yiiframework.com/doc-2.0/guide-runtime-logging.html
Accordingly, this config:

[
    'class' => 'yii\log\FileTarget',
    'levels' => ['error'],
    'except' => [
        'yii\web\HttpException:404',
    ],
]

Will output only error without 404 etc. See the link above for more details.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question