Writing logs in app.log isn't working

Good, I can’t track any Yii trace/debug to @rutime/logs/app.log file, except what is generated byt the propper application.

For instance, in a controller I set php Yii::trace('whatever'); but in the file app.log I can’t see the whatever word.

I have configured the log as the following:

        'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'levels' => ['error', 'warning', 'trace'],
                ],
                [
                    'class' => yii\log\SyslogTarget::class,
                    'levels' => ['error', 'warning', 'trace']
                ]
            ],
        ],

As I said, the only written to the file is for instance, a 404 error, any php warning or any syntax error, but trying to write in the log file with Yii::debug or Yii::trace isn’t working.

'traceLevel' => YII_DEBUG ? 3 : 0,

If you’re not in debug mode, trace won’t be collected.