csslowlogroute Log profile entries slower than treshold or more frequent than treshold

  1. Requirements
  2. Usage

This log route logs profile entries slower than provided treshold in seconds or more frequent than provided treshold. It does not show those entries on web page so you can turn it on even on production site (for some time) to debug bottlenecks.

Requirements

based on standard CFileLogRoute, profile processing took from CProfileLogRoute, should work with every Yii version (tested on 1.1.9)

Usage

just extract extension in your application extensions directory and put configuration in your config file:

'log'=>array(
	'class'=>'CLogRouter',
	'routes'=>array(
		array( 'class'=>'ext.CSSlowLogRoute',
			'logSlow'=>3, //log profile entries slower than 3 seconds (you can use decimals here)
			'logFrequent'=>3 //log profile entries which occured more than 3 times
	 	),
	),
),

you can also turn on profiling on database queries to get them in slowlog:

'db'=>array(
	...
	'enableParamLogging'=>true,
	'enableProfiling'=>true,
),
4 0
2 followers
359 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Logging
Developed by: Maciej Liżewski
Created on: Feb 7, 2012
Last updated: 12 years ago

Downloads

show all

Related Extensions