Debug Vs. Log

Hello! The Yii-Debugger is very nice to analyse the page. But it tracks everything. Independent from beeing a normal request or an error. This is good for testing, but I want to analyse my live page as well, but only the errors. I can look into the /runtime/logs/app.log file, but this is not very comfortable. Is there a way to display the content of the app.log file in the Yii-Debugger?

In debug there are filters that you can use to get errors only.

Hello samdark! Nice to get a reply from one of the main developer!!

Yes, but in Production mode I have thousands of requests. But I only want to log the errors. I don’t know where to set this option. In /frontend/config/main.php I already specified [components][log][targets][levels] => [error]. But this only affects the /runtime/logs/app.log file.




'log' => [

    'traceLevel' => YII_DEBUG ? 3 : 0,

    'targets' => [

        [

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

            'levels' => ['error', 'warning'],

        ],

        [

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

            'levels' => ['error'],

            'logFile' => '@runtime/logs/error.log'

        ],

    ],

],



You should not use debug toolbar in production.

I only want to use the debug-module for analysing the errors logged in /runtime/logs/app.log

Because the debug-module displays the erros very nice :wink: To look into the app.log is not comfortable, because it is just plain text. How do you analyse the app.log file in production-mode?!

Well, personally I’m using https://rollbar.com/ for production logging. Debug toolbar can’t read logs since it needs more info.