PHP code example of shiwenyuan / xdp-log

1. Go to this page and download the library: Download shiwenyuan/xdp-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/ */

    

shiwenyuan / xdp-log example snippets


@mkdir(__DIR__."/logs");
$num = rand(1,100);

$GLOBALS['LOG'] = [
    'log_file' => __DIR__."/logs/".$num.'.log', 设置log目录
    'log_level' => \XdpLog\MeLog::LOG_LEVEL_ALL,设置写入log级别 如果小于这个级别则不被记录
];

MeLog::debug('aaaa');
MeLog::warning('aaaa');
MeLog::fatal('aaaa');
MeLog::notice('aaaa');
MeLog::trace('aaaa');