// in my PHP code
$log = new Logger('LaurentCommand');
$log->pushHandler(new StreamHandler('./app/logs/LaurentCommand.log'));
$log->addInfo("Start command",array('username' => 'Joe', 'Age' => '28'));
Run Code Online (Sandbox Code Playgroud)
结果在日志文件LaurentCommand.log中:
[2012-12-20 10:28:11] LaurentCommand.INFO:开始命令{"username":"Joe","Age":"28"} []
为什么这个支架到底?