CSExcludeLogRoute provides fine-grained, nested negative filters for logs. It works as a filter and transparently send logs matching criteria to nested LogRoutes. Lets you configure scenario like this "log from every category except single subcategory" and similiar.
Requirements ¶
tested in Yii 1.1.10 and 1.1.11 but should work in older versions too
Usage ¶
Just use in config files like this:
'components'=>array(
'log'=>array(
'class'=>'CLogRouter',
'routes'=>array(
//log all logs from every category with every level except logs from 'system.db.*' and 'system.CModule' categories (any level)
array(
'class'=>'CSExcludeLogRoute',
'excludeCategories'=>'system.db.*,system.CModule',
'routes'=>array(
array(
'class'=>'CWebLogRoute',
),
...
),
),
//log all logs from system.* categories except logs from system.db.* categories which have 'warning' level
array(
'class'=>'CSExcludeLogRoute',
'categories'=>'system.*',
'excludeCategories'=>'system.db.*',
'excludeLevels'=>'warning',
'routes'=>array(
array(
'class'=>'CWebLogRoute',
),
...
),
),
...
),
),
...
),
To all (the only) subscribers: As soon as Yii 1.1.13 is officialy published this extension is no longer supported as there will be native support for negative filters. Anyway, if someone still uses older version - use this instead :)
Currently being added to Yii 1.1.13
So in the future, it'll be handled in the framework natively.
re: Currently being added to Yii 1.1.13
Nice to hear it. Extension was developed when there was no sign that this could be natively supported...
Understood
And thanks for the work! I've just been watching it recently on Github and thought you might want to know:
https://github.com/yiisoft/yii/pull/1376
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.