Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yii2 basic. migration issue #10

Open
paskuale75 opened this issue Dec 11, 2019 · 0 comments
Open

yii2 basic. migration issue #10

paskuale75 opened this issue Dec 11, 2019 · 0 comments

Comments

@paskuale75
Copy link
Contributor

paskuale75 commented Dec 11, 2019

After launch the migration command from shell, it return me this:
yii\base\InvalidConfigException' with message 'You should configure "log" component to use one or more database targets before executing this migration.

My /config/web.php (components)


'log' => [
            'targets' =>
                [
                    // per inviare i log x email
                    // decommentare qui sotto...
                    /*[
                        'class' => EmailTarget::className(),
                        'message' => [
                            'to' => '**********@gmail.com',
                            'from' => '[email protected]',
                            'subject' => 'Apollo11 Error Logger'
                        ],
                        'excludeKeys' => [
                            'yii\base\application*',
                            'yii\db\Command:*',
                            'yii\db\Connection*',
                            'yii\web\Session:*',
                            'yii\web\HttpException:*',
                            'yii\log\Dispatcher:*',
                            'yii\mail\BaseMailer:*',
                            'yii\swiftmailer\Mailer:*',
                            'yii\web\HeadersAlreadySentException'
                        ],
                    ],*/
                    [
                        'class' => SlackTarget::class,
                        // If async is set to true you have to provide consoleAppPath
                        'async' => true,
                        'consoleAppPath' => Yii::getAlias('@main/yii'),
                        // If you would like to use different php binary, when sending messages asynchronously you can set it from here
                        // 'phpExecPath' => 'php',
                        // Provide here keys which will be hidden before sending messages. It is case insensitive
                        //'excludeKeys' => [
                        //'*PASSWORD*', // Will hide all keys from $GLOBALS objects which contains "password".
                        //'*PASSWORD', // Will hide all keys from $GLOBALS objects which ends with "password".
                        //'PASSWORD*', // Will hide all keys from $GLOBALS objects which starts with "password".
                        //],

                        'except' => [
                            'yii\web\HttpException:*',
                            'yii\web\HeadersAlreadySentException',
                            'yii\httpclient\StreamTransport::send',
                            'yii\db\Connection::open'
                        ],
                        'webhookUrl' => 'https://hooks.slack.com/services/TNGBBB2AE/BN**V2D5J/llDAUMIfF******Wnv9iVdWE4',
                        'icon_url' => 'https://slack.com/img/icons/app-57.png',
                        'icon_emoji' => ':bug:', // If both, icon_url and icon_emoji is provided system will use icon_emoji
                        'levels' => ['info'],
                        //'logVars' => [],
                        'categories' => ['all'],
                        'title_link' => '',
                        'username' => 'all_bot',                        
                    ],
                    [
                        'class' => DbTarget::className(),
                        'except' => [
                            'yii\base\application*',
                            'yii\db\Command:*',
                            'yii\db\Connection*',
                            'yii\web\Session:*',
                            'yii\web\HttpException:*',
                            'yii\log\Dispatcher:*',
                            'yii\mail\BaseMailer:*',
                            'yii\swiftmailer\Mailer:*',
                            'yii\web\HeadersAlreadySentException',
                            'yii\debug\Module::*'
                        ],
                        //'categories' => ['yii\web\HttpException:404'],
                        // tutti i levels
                        'levels' => ['info'],
                        'categories' => ['motorizzazione'],
                        'logVars' => [],
                        //'logTable' => '@runtime/logs/404.log',
                    ],
                    [
                        'class' => FileTarget::className(),
                        'except' => [
                            'yii\base\application*',
                            'yii\db\Command:*',
                            'yii\db\Connection*',
                            'yii\web\Session:*',
                            'yii\web\HttpException:*',
                            'yii\log\Dispatcher:*',
                            'yii\mail\BaseMailer:*',
                            'yii\swiftmailer\Mailer:*',
                            'yii\web\HeadersAlreadySentException'
                        ],
                        //'categories' => ['yii\web\HttpException:404'],
                        // tutti i levels
                        'levels' => ['warning', 'info'],
                        'fileMode' => 0777,
                        //'categories' => ['logAlls'],
                        'logVars' => [],
                        //'logTable' => '@runtime/logs/404.log',
                    ],
                ],
        ],
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant