LotusPhp notes: how to use the Logger component

  • 2020-06-01 08:57:47
  • OfStack

Today is busy, originally wanted to write more content, temporarily have no way, picked up a relatively simple component to write well, the next few chapters are to introduce components.

The use of LtLogger is relatively simple, the basic code is running in the environment of Autoloader, so I am lazy to refer to what path, call what library, know how to use it.

$log=new LtLogger();

// define the storage path of log
$log- > conf('log_file' = > '/log/system.log');

$log- > log(date(' Y-m-d ').' add the name of the current program and the operator is a log ');

If the file itself does not exist, it will be directly created in the specified path. If the file does exist, it will be appended to the log. By default, each log will be split with "\t".

Related articles: