Wrong entries in log files

Hello,

I have some long running console script, that I want to monitor.

For that I use a configuration like this:




'log' => [

// ...

    'targets' => [

        [

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

// ...      

        ],

// ... 

       [

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

            'levels' => ['info'],

            'categories' => ['foo'],

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

       ],



And then I use this to log:




Yii::info($message, 'foo');



But I always have a "application" entry in my log file like this:




2015-03-16 09:25:01 [-][-][-][info][foo] test log...

2015-03-16 09:24:01 [-][-][-][info][application] $_SERVER = [ ... ]



How can I get rid of this entry? I only want the "foo" entries in this file…

Hope somebody can help me :)

Thanks,

Urkman

No one with an answer for that?

Then this seems to be a bug…

Where can I file a bug report?

It’s not a bug. It’s called trace http://www.yiiframework.com/doc-2.0/guide-runtime-logging.html#message-trace-level

Sorry, I don’t get it:(

I changed my target to:




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

                    'levels' => ['trace'],

                    'categories' => ['foo'],

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



Then I ‘trance’:




Yii::trace($message, 'foo');



And still:




2015-03-21 14:40:08 [-][-][-][trace][foo] send: test message

2015-03-21 14:40:07 [-][-][-][info][application] $_SERVER = [...]



Why there is no easy way to disable the ‘application’ category?

Thanks,

URkman

Add




'logVars' => []