Home > Backend Development > PHP Tutorial > LotusPhp笔记之:Logger组件的使用方法_PHP

LotusPhp笔记之:Logger组件的使用方法_PHP

WBOY
Release: 2016-06-01 12:06:59
Original
663 people have browsed it

今天比较忙,本来想写多点内容,暂时没有办法了,捡个比较简单的组件来写下好了,往后的几章都是介绍组件。

LtLogger的使用还是比较简单的,基本代码都是在Autoloader的环境下运行的,所以我也懒的去引用神马路径,调用神马类库,知道怎么用就可以了。

$log=new LtLogger();

//自己定义log的存放路径
$log->conf('log_file' => '/log/system.log');

$log->log(date('Y-m-d').' 加上当前程序名,操作人就是一条日志了');

挺简单的吧,如果文件本身不存在,会直接创建在指定的路径里,文件存在的话,会追加到日志里,默认每条日志以"\t"来进行分割。

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template