Skip to content

Instantly share code, notes, and snippets.

@dominicgan
Last active July 1, 2016 04:38
Show Gist options
  • Save dominicgan/f6ad5e2ac9af2f89915bf22ce8c6310e to your computer and use it in GitHub Desktop.
Save dominicgan/f6ad5e2ac9af2f89915bf22ce8c6310e to your computer and use it in GitHub Desktop.
Yii config to enable both yii log types
<?php
// you will need to create multiple vhost to view both log types
$http_host_development_trace = "www.url.trace"; // first vhost
$http_host_development_debug = "www.url.debug"; // second vhost
if (isset($_SERVER["HTTP_HOST"]) && $_SERVER["HTTP_HOST"] == $http_host_development_trace) {
$db['username'] = 'root';
$db['password'] = 'root';
$db['enableProfiling'] = true;
$db['schemaCachingDuration'] = 60;
$log['routes'][] = array(
'class'=>'CWebLogRoute',
'levels'=>'trace, info',
'categories'=>'system.*',
);
$srbac_debug = false;
}
if (isset($_SERVER["HTTP_HOST"]) && $_SERVER["HTTP_HOST"] == $http_host_development_debug) {
$db['username'] = 'root';
$db['password'] = 'root';
$db['enableProfiling'] = true;
$db['schemaCachingDuration'] = 60;
$log['routes'][] = array(
'class' => 'CProfileLogRoute',
'report'=>'summary',
'levels'=>'error, warning, trace, info, private',
'categories'=>'system.*',
);
$srbac_debug = false;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment