PHP code example of besnovatyj / yii2-cms-log-manager-db

1. Go to this page and download the library: Download besnovatyj/yii2-cms-log-manager-db library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

besnovatyj / yii2-cms-log-manager-db example snippets


return [
    // the "log" component must be loaded during bootstrapping time
    'bootstrap' => ['log'],
    // the "log" component process messages with timestamp. Set PHP timezone to create correct timestamp
    'timeZone' => 'America/Los_Angeles',
    'components' => [
        'log' => [
            'targets' => [
               'database' =>  [
                    'class' => 'yii\log\DbTarget',
                    'levels' => ['error', 'warning'],
                    'categories' => ['yii\db\*'],
                    'logTable' => '{{%log_logs}}',
                ],
            ],
        ],
    ],
];