Maybe exist solution to skip 404 exceptions ? I'mean not store this messages in log file ?
2015/04/09 12:28:52 [error] [exception.CHttpException.404] exception 'CHttpException' with message 'Невозможно обработать запрос "offer/downloadOffer".' in /var/www/yii/framework/web/CWebApplication.php:286
Stack trace:
#0 /var/www/yii/framework/web/CWebApplication.php(141): CWebApplication->runController('offer/downloadO...')
#1 /var/www/yii/framework/base/CApplication.php(184): CWebApplication->processRequest()
#2 /var/www/LAP/www/index.php(16): CApplication->run()
#3 {main}
REQUEST_URI=/offer/downloadOffer
For Yii 2.0, you can make your config/main.php like this:
return [
'components' => [
'log' => [
'traceLevel' => YII_DEBUG ? 3 : 0,
'targets' => [
[
'class' => 'yii\log\FileTarget',
'levels' => ['error', 'warning'],
'except' => ['yii\web\HttpException:404'],
],
],
],
],
];
For Yii 1.1, the correct way to exclude a category is to use the except
key. Prepending a !
in the categories
key as per the accepted answer will actually result in only matching categories that start with a !
. So whilst it might appear to work, you're actually going to be suppressing all categories. See the filterAllCategories()
function of the source code - there's no processing of the !
character, only for the *
wildcard: GitHub Source.
I tried the !exception.CHttpException.404
approach in the accepted answer and thought I'd solved the issue of hiding the 404 errors, but then I realised after much hair pulling that this was resulted in no logs being logged!
The correct syntax to ignore a category is:
array(
'class' => 'CFileLogRoute',
'except' => 'exception.CHttpException.404'
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With