PHP code example of macfly / yii2-stream-log

1. Go to this page and download the library: Download macfly/yii2-stream-log 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/ */

    

macfly / yii2-stream-log example snippets


  'bootstrap' => [
      'log',
      'streamlog',
  ],
  'modules' => [
     ................
     'streamlog' => [
         'class' => 'macfly\streamlog\Module',
         'redisTarget' => [
             'exportInterval' => 1,
             'logVars'        => [],
             'logUser'        => true,
             'logApp'         => true,
             'logTracker'     => true,
             'logUserIp'      => true,
             'logSession'     => true,
             'userNameAt'     => 'username',
         ],
         'elasticsearchTarget' => [
            'indexDateFormat' => 'y-MM-dd', // Set date to append to index, will be yii-2018-10-24
        ],
    ],
    ................
  ],
sh
php yii streamlog/sender/start