PHP code example of sunbirder / socketlog

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

    

sunbirder / socketlog example snippets


         slog('hello world');
        

         slog(array(
        'error_handler'=>true
        ),'config');
        echo notice;//制造一个notice报错
        slog('这里是输出的一般日志');
        

         slog(array(
        'enable'=>true,//是否打印日志的开关
        'host'=>'localhost',//websocket服务器地址,默认localhost
        'optimize'=>false,//是否显示利于优化的参数,如果运行时间,消耗内存等,默认为false
        'show_认为空,表示所有人都可以获得日志。
        )
        ,'config');