achertovsky / yii2-debug-cli

7 stars 4 forks source link

More detailed how-to pelase #1

Open gb5256 opened 4 years ago

gb5256 commented 4 years ago

Hello, I am struggeling getting it to work. I think that a more detailed how-to is necessary. For example:

  1. Does this work with the advanced template ?
  2. Which configs to add the module? console/config? frontend/config? both?

This is what I did so far to my console/config/main:

'modules' => [
    'debug' => [
        'class' => 'achertovsky\debug\Module',
        'logTarget' => 'achertovsky\debug\LogTarget',
    ],
],
'components' => [
    'log' => [
        'targets' => [
            [
                'class' => 'yii\log\DbTarget',
            ],
        ],
    ],

Thanks. gb5256

achertovsky commented 4 years ago

hello, @gb5256 thanks for your attention to my override :)

  1. it does work with advanced template, i'm personally using it in that way.
  2. in advanced template i use it on common level config.

according your config, especially, modules->debug section it seem correct, but place it into common-level config (common/config/main.php)

never tried to use the extension with database log target. would like to know if it works after you put config in recommended place. if it does not working - let me know. i will configure blank project, test it and fix the issue.

gb5256 commented 4 years ago

Hi have tested your recommendation, but I do not get it to work with a DB target. Perhaps you could try it yourself? Thanks! gb5256

achertovsky commented 4 years ago

Hello. Yep, i will try to do it asap. In spare minute, when i'll have one. Will keep u posted here

achertovsky commented 4 years ago

Hi! Sorry for delay.

I just tested DbTarget. Did nothing special, everything according to manual: created target with it

'components' => [
        'log' => [
            'targets' => [
                'idkname' => [
                    'class' => 'yii\log\DbTarget',
                    'logVars' => [],
                ],
            ]
        ]
    ]

and applied migration yii migrate --migrationPath=@yii/log/migrations/ tested, logs going there.

after i understood, that /debug is not displaying logs of db inside, tried to use yii2-debug and didnt find database logs.

what you expected to see when claimed that its not working?

thanks!