[TOC] ## 概述 在`mainServerCreate`定义日志回调 ``` //进行日志的回调操作 Logger::getInstance()->onLog()->set('myHook',function ($msg,$logLevel,$category){ //增加日志写入之后的回调函数 var_dump(sprintf("category : %s , logLevel : %s , msg : %s", $category,$logLevel,$msg)); }); ``` 触发 ``` //记录日志并输出到控制台 Logger::getInstance()->info('log level info'); Logger::getInstance()->notice('log level notice'); Logger::getInstance()->waring('log level waring');/ Logger::getInstance()->error('log level error');/ ```