Skip to content

Instantly share code, notes, and snippets.

@cebe
Created March 15, 2012 14:09
Show Gist options
  • Select an option

  • Save cebe/2044368 to your computer and use it in GitHub Desktop.

Select an option

Save cebe/2044368 to your computer and use it in GitHub Desktop.
yii debug ajax request with CWeblogRoute
<?php
// ...
public function actionXXX()
// ...
$this->beginClip('debug');
Yii::app()->log->processLogs(null);
Yii::app()->detachEventHandler('onEndRequest',array(Yii::app()->log,'processLogs'));
$this->endClip();
$this->sendJsonResponse(array(
'html' => $resultingUsersList . $this->getClips()->itemAt('debug'),
));
}
<?php
// config file
return array(
'components'=>array(
'db' => array(
'enableParamLogging' => true,
'enableProfiling' => true,
),
'log' => array(
'routes' => array(
array(
'class' => 'CWebLogRoute',
'categories' => 'user.*',
'categories' => 'user.*, system.db.*',
'showInFireBug'=>true,
'ignoreAjaxInFireBug'=>false,
),
),
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment