PHP code example of xyzphp / log

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

    

xyzphp / log example snippets


        Xyzphp\Log\LogServiceProvider::class,

    
        'log_path' => env('APP_LOG_PATH', storage_path('logs/laravel.log')),

    $data = ['name'=>'xyz','sex'=>'男'];
    
    info("info_message",$data);              //记录info 级别的日志
    notice("notice_message",$data);          //记录notice 级别的日志
    debug("debug_message",$data);            //记录debug 级别的日志
    warning("warning_message",$data);        //记录warning 级别的日志
    critical("critical_message",$data);      //记录critical 级别的日志
    alert("alert_message",$data);            //记录alert 级别的日志
    emergency("emergency_message",$data);    //记录emergency 级别的日志