No, you only need to use main-custom.phpShould I add something to apps/common/config/main.php?
return array(
'components' =>
array(
'db' =>
array(
'connectionString' => 'mysql:host=localhost;dbname=mailwizz',
'username' => 'root',
'password' => '',
'tablePrefix' => 'mw_',
),
// THIS component
'log' => array(
'routes' => array(
array(
// This route will store info, warning, and error to application.log
array(
'class' => 'CFileLogRoute',
'filter' => 'CLogFilter',
'levels' => 'info, warning, error',
),
// This route will store info, warning, and error to your-extension.log
array(
'class' => 'CFileLogRoute',
'logFile' => 'your-extension.log',
'filter' => 'CLogFilter',
'levels' => 'info, warning, error',
),
// This route will store info, warning, error to db table application_log
array(
'class' => 'CDbLogRoute',
'connectionID' => 'db',
'logTableName' => '{{application_log}}',
'filter' =>
array(
'class' => 'CLogFilter',
'logUser' => false,
'logVars' =>
array(
0 => '_GET',
1 => '_POST',
2 => '_FILES',
3 => '_SESSION',
),
),
'levels' => 'info, warning, error',
),
),
),
),
),
);
Yes, if you're using the `CFileLogRoute`Should the logged lines appear in apps/common/runtime?
That is because the categories will be up to you. In my extensions, I always use the format "ext.you-extension-name.appName". So it will look like this in the codeI never found this to be clear in Yii's documentation.
Yii::log("Something went wrong", CLogger::ERROR, "ext.your-extension-name.backend");
// This route will store info, warning, and error to your-extension.log
array(
'class' => 'CFileLogRoute',
'logFile' => 'your-extension.log',
'filter' => 'CLogFilter',
'levels' => 'info, warning, error',
// this log route will capture all categories that starts with ext.
'categories' => 'ext.*'
),