All error logs to file A but one category to file B

Hi,

The Cookbook tells tow to dispatch various log categories to different files:

https://yii2-cookbook.readthedocs.org/logging-problems-and-solutions/

But they put "category" option for each entry.

On the other hand I would like to log ALL to file A but one special category to file B.

Will this work as expected:


'components' => [

    'log' => [

        'targets' => [

                [

                    'class' => 'yii\log\FileTarget',

                    'logFile' => '@app/runtime/logs/A.log',

                ],

                [

                    'class' => 'yii\log\FileTarget',

                    'categories' => ['special'],

                    'logFile' => '@app/runtime/logs/B.log',

                ],

        ],

  ...

Can you advise?

Thanks ahead!

Add


'except' => ['special'],

for the first one.

http://www.yiiframework.com/doc-2.0/yii-log-target.html#$except-detail

(or if I read this wrong and you want to keep everything with ‘special’ in A and only ‘special’ in B leave it as it is, it’s good).