2017 © Pedro Peláez
 

library qclog

A package that allows you to use monolog more flexibly.

image

huy/qclog

A package that allows you to use monolog more flexibly.

  • Monday, May 23, 2016
  • by faquiiR
  • Repository
  • 1 Watchers
  • 1 Stars
  • 2 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

qclog

Monolog简单封装,可以方便的指定日志输出格式和日志路径。, (*1)

usage

拷贝qclog.phpapp\config目录下,默认的配置如下:, (*2)

<?php

return [

  'dateFormat' => "Y-m-d H:i:s",  //时间格式
  'outputFormat' => "[%datetime%] %channel%.%level_name%: %message% %context% %extra%\n", //日志格式

  'userLog' => [
    //'file' => '/var/log/php/user.log',
    'dateFormat' => 'Y n j, g:i a'
  ],

  'goodsLog' => [
    'file' => '/var/log/php/goods.log'
  ],

];

'dateFormat'和'outputFormat'指定时间格式和日志输出格式。
'userLog'和'goodsLog'里面配置的'dateFormat'和'outputFormat'会覆盖外层配置。 'file'配置日志输出的文件。, (*3)

然后可以这样使用:, (*4)

use Qc\QcLog;

QcLog::userLog()->addInfo('hello');
QcLog::goodsLog()->addWarning('this goods is missing');
QcLog::addInfo('this message will be wirtten in storage/logs/laravel.log');

类似addInfo的方法有: 'addInfo', 'addDebug', 'addNotice', 'addWarning','addEmergency', 'addAlert', 'addCritical', 'addError', (*5)

这些是monolog基础方法。, (*6)

The Versions

23/05 2016

dev-master

9999999-dev

A package that allows you to use monolog more flexibly.

  Sources   Download

MIT

The Requires

  • php >=5.5.9

 

by hushaofei