定制 jotweh/codeception-monolog 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

jotweh/codeception-monolog

最新稳定版本:1.1.0

Composer 安装命令:

composer require jotweh/codeception-monolog

包简介

Monolog Extension for Codeception

README 文档

README

What is it?

The default Codeception Logger extension (see http://codeception.com/addons) always uses a RotatingFileHandler for Logging, which writes to a codeception-<date>.log file. This was not sufficient for me so I created this configurable Monolog logging extension. It allows usage of multiple log handlers with custom configuration (see below for an example). Currently only log handlers are supported, that do not require objects in their constructor parameters, such as:

  • NativeMailHandler
  • FirePHPHandler
  • RotatingFileHandler
  • HipChatHandler
  • ErrorLogHandler
  • ...

The log handlers will currently only be triggered in case of a failed test.

Installation

Currently not available via packagist, so you'll have to add this to your composer.json:

  ...
  "repositories": [
    {
      "type": "vcs",
      "url": "git@github.com:jotweh/codeception-monolog.git"
    }
  ],
  "require": {
    "jotweh/codeception-monolog": "dev-master",
    ...
  }
  ...

Configuration

Enable the Extension in your codeception.yaml like this:

extensions:
    enabled:
        - Codeception\Extension\CodeceptionMonolog

You can configure multiple log handlers in your codeception.yaml:

extensions:
    enabled:
        - Codeception\Extension\CodeceptionMonolog
    config:
            Codeception\Extension\CodeceptionMonolog:
                message: "Test %s failed. Please check. Error Message: %s."
                handlers:
                    NativeMailerHandler:
                          to: 'test@example.com,othertest@example.com'
                          subject: 'Email Subject'
                          from: 'Monitoring'
                          level: 400 #error log level
                    HipChatHandler:
                          token: 'somecryptichipchattoken'
                          room: 'HipChatRoomName'
                          name: 'Notifier'
                          notify: true
                          level: 400 #error log level

In the handlers section, each key is a Monolog handler class name. The values are the constructor parameters for the handler. In the example above, the HipChatHandler and the NativeMailerHandler are used. So when a test fails, an email and a hipchat notification will be sent.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-02-11

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固