PHP code example of kriss / yii2-log-reader

1. Go to this page and download the library: Download kriss/yii2-log-reader library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

kriss / yii2-log-reader example snippets


return [
    'bootstrap' => ['log-reader'],
    'modules' => [
        'log-reader' => [
            'class' => 'kriss\logReader\Module',
            //'as login_filter' => UserLoginFilter::class, // to use login filter
            'aliases' => [
                'Frontend' => '@frontend/runtime/logs/app.log',
                'Backend' => '@backend/runtime/logs/app.log',
                'Console' => '@console/runtime/logs/app.log',
            ],
            //'defaultTailLine' => 200,
        ],
    ],
];

http://localhost/path/to/index.php?r=log-reader

http://localhost/path/to/log-reader

[
    'class' => 'yii\log\FileTarget',
    'categories' => ['test'],
    'logVars' => [],
    'logFile' => '@runtime/logs/test/test.log.' . date('Ymd'), // important
    'maxLogFiles' => 31,
    'dirMode' => 0777,
    'fileMode' => 0777,
]

'test' => '@runtime/logs/test/test.log'