csexcludelogroute provides negative filters for logs and nested routes

  1. Requirements
  2. Usage

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 :)

1 0
2 followers
289 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Logging
Developed by: Maciej Liżewski
Created on: Aug 3, 2012
Last updated: 12 years ago

Downloads

show all

Related Extensions