PHP code example of anhoder / swoft-log-handler

1. Go to this page and download the library: Download anhoder/swoft-log-handler 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/ */

    

anhoder / swoft-log-handler example snippets


'testHandler'   => [
    'class'     => Anhoder\Swoft\Log\RotatingFileHandler::class,
    'logFile'   => '@runtime/logs/test/test-%d{Y-m-d}.log',
    'levels'    => 'notice,info,debug,trace,error,warning',
    'formatter' => bean('lineFormatter'),
    'maxFiles'  => 3,
    'checkLogInterval' => RotatingFileHandler::INTERVAL_DAY,
],