承接 makopov/simple-log 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

makopov/simple-log

Composer 安装命令:

composer require makopov/simple-log

包简介

A simple log wrapper around syslog, loosely based on PSR-3

README 文档

README

A simple log wrapper around syslog

Simple Log is a singleton class that makes logging to syslog very easy.

Get an object instance:

$oLogger = SLog::getInstance();

Configure application name (optional). If not set syslog will show 'php' as the application name. Good to do upon a bootstrap or init of applications.

$oLogger->setApplicationName('MyApp');

Now log! Using any of the 8 log level

$oLogger->emergency('some message');
$oLogger->alert('some message');
$oLogger->critical('some message');
$oLogger->error('some message');
$oLogger->warning('some message');
$oLogger->notice('some message');
$oLogger->info('some message');
$oLogger->debug('some message');

Log messages will appear in syslog (/var/log/messages). By default Simple Log will include the file name and line number of where the log was made from.

Example:

Foo.php

function foo() {
    $oLogger->warning('something happened');
}

Will show up in syslog like so:

Feb 26 22:11:47 localhost MyApp: Foo.php:2 - something happened

Thats it! Please submit bugs as you see them. I will add tests in the near future.

统计信息

  • 总下载量: 37
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2016-03-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固