E
E
Express7772016-03-01 16:43:10
Yii
Express777, 2016-03-01 16:43:10

How to limit log size?

Hello.
How to reset/restart logging to a log when a certain file size (can be lines) that is stored in the runtime/logs folder is reached in YII2?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander N++, 2016-03-01
@Express777

'log' => [
            'traceLevel' => YII_DEBUG ? 3 : 0,
            'targets' => [
                [
                    'class' => 'yii\log\FileTarget',
                    'categories' => ['yii\web\HttpException:404'],
                    'logFile' => '@app/runtime/logs/404.log',
                    'levels' => ['error', 'warning'],
                    'maxFileSize' => 1024 * 4,
                    'maxLogFiles' => 5,
                ]
            ],
        ],

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question