承接 slaxweb/logger 相关项目开发

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

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

slaxweb/logger

最新稳定版本:0.5.0

Composer 安装命令:

composer require slaxweb/logger

包简介

Logger component for SlaxWeb Framework

README 文档

README

The SlaxWeb\Logger component is only a simple wrapper around the Seldaek/monolog library to provide an easier integration into the SlaxWeb\Framework. It provides only a Service Provider for the Pimple Dependency Injection Container, and a Factory for instantiation of the logger library. The Logger component also depends on the Config component of the SlaxWeb\Framework.

Installation

Easiest method of installation is through composer, to install just edit your composer.json file to contain:

{
    "require": {
        "slaxweb/logger": "~0.2"
    }
}

Usage

To instantiate the logger through the Factory you first need to instantiate the Config component, as the Factory will require it to successfully instantiate the logger. The Config component has to provide the following three configuration items:

  • logger.name - Used by Monolog as the name of the logger
  • logger.loggerType - Used to determine which Monolog Logger Handler to use for the logger, value needs to match the name of the Handler class, currently only StreamHandler is supported
  • logger.handlerArgs.<logger.loggerType> - Argument list that are going to be passed to the Handler instantiation

When all of the above is set, you may safely call the Factory::init method, and you will retrieve an instance of the logger in return.

$logger = \SlaxWeb\Logger\Factory::init($config);

If you wish to use the Service Provider, then you need to make sure that the Config components Service Provider is registered prior to trying to accessing the logger definition. Of course, the above configuration items are required as well. All that remains to do is to register the Service Provider of the logger, and it will define the logger instantiation to the logger.service key name.

$container->register(new \SlaxWeb\Logger\Service\Provider);
$container["logger.service"]->addInfo("Logger loaded");

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-06-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固